aboutsummaryrefslogtreecommitdiff
path: root/src/pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipe.c')
-rw-r--r--src/pipe.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pipe.c b/src/pipe.c
index 997be2d..9fc8406 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -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