diff options
| author | iamcheeseman <[hidden email]> | 2026-03-01 11:10:54 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-03-01 11:10:54 -0500 |
| commit | 998cb175da5fc8b95151f4e632e3024791e3196d (patch) | |
| tree | 3a08682b9b6840f85ed6466efd6bc39369f396da /src/pipe.c | |
| parent | 6d17f1ca1f4e2c85e8aed05e6902196f1274cf87 (diff) | |
bring code up to standards
Diffstat (limited to 'src/pipe.c')
| -rw-r--r-- | src/pipe.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,24 +1,25 @@ +#include "pipe.h" -#include <stdio.h> +#include <ctype.h> #include <fcntl.h> -#include <unistd.h> -#include <sys/stat.h> +#include <stdbool.h> +#include <stdio.h> #include <string.h> -#include <ctype.h> +#include <sys/stat.h> +#include <unistd.h> -#include "pipe.h" #include "bardata.h" FILE *named_pipe; -void init_pipe() { +void init_pipe(void) { mkfifo(PIPE_PATH, 0666); named_pipe = fopen(PIPE_PATH, "r"); } -void await_change() { +void await_change(void) { char buff[1024]; - while (1) { + while (true) { if (!fgets(buff, sizeof(buff), named_pipe)) { fclose(named_pipe); named_pipe = fopen(PIPE_PATH, "r"); // This blocks, 0% CPU, yay |
