diff options
| author | Maarten van Gompel <proycon@anaproy.nl> | 2021-09-19 14:23:51 +0200 |
|---|---|---|
| committer | John Sullivan <jsullivan@csumb.edu> | 2021-10-19 23:12:01 -0700 |
| commit | 81159507d35ef087dfd796c08af07c1902e270e5 (patch) | |
| tree | e90bb57e65614d214d6c9d7e08e1e0f29298ee40 /shm_open.c | |
| parent | 6c9636c137d0426c38fc6bdc655c3d327ddab4c2 (diff) | |
| download | suggpicker-81159507d35ef087dfd796c08af07c1902e270e5.tar.gz | |
applied clang-format (no functional changes), but exempted custom include order in keyboard.c and main.c
Diffstat (limited to 'shm_open.c')
| -rw-r--r-- | shm_open.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/shm_open.c b/shm_open.c index 05cb571..1dfa81a 100644 --- a/shm_open.c +++ b/shm_open.c @@ -6,21 +6,19 @@ #include <unistd.h> static void -randname(char *buf) -{ +randname(char *buf) { struct timespec ts; long r; clock_gettime(CLOCK_REALTIME, &ts); r = ts.tv_nsec; for (int i = 0; i < 6; ++i) { - buf[i] = 'A'+(r&15)+(r&16)*2; + buf[i] = 'A' + (r & 15) + (r & 16) * 2; r >>= 5; } } static int -create_shm_file(void) -{ +create_shm_file(void) { int retries = 100; int fd; do { @@ -37,8 +35,7 @@ create_shm_file(void) } int -allocate_shm_file(size_t size) -{ +allocate_shm_file(size_t size) { int fd = create_shm_file(); int ret; if (fd < 0) @@ -52,4 +49,3 @@ allocate_shm_file(size_t size) } return fd; } - |
