summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <loic.guegan@mailbox.org>2024-02-02 13:39:57 +0100
committerLoic Guegan <loic.guegan@mailbox.org>2024-02-02 13:39:57 +0100
commit9ba1763b4f1b4aa5e65fc45a0dc5eef620b1d4ee (patch)
treedfd9bc8815190626e9b7e4d97815da588153754d
parentcab15f605ef02eeea413f9db45d2ffa7f3d0172e (diff)
Minor changes
-rw-r--r--src/publisher.c11
-rw-r--r--src/utils.c15
-rw-r--r--src/utils.h1
3 files changed, 15 insertions, 12 deletions
diff --git a/src/publisher.c b/src/publisher.c
index a16628a..c213c3c 100644
--- a/src/publisher.c
+++ b/src/publisher.c
@@ -33,17 +33,6 @@ void sighandler(int signo) {
void *publisher(void *zmq_publisher);
-void askforbreak(char *break_file){
- FILE * file;
- file = fopen(break_file, "r");
- while(file){
- printf("I am doing a break for %ds\n", BREAK_DURATION);
- sleep(BREAK_DURATION);
- fclose(file);
- file = fopen(break_file, "r");
- }
-}
-
typedef struct queue {
int size;
char issending;
diff --git a/src/utils.c b/src/utils.c
index 832cc9b..80149d5 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,4 +1,6 @@
#include "utils.h"
+#include <stdio.h>
+#include <unistd.h>
void mkdirp(char *path){
char buffer[255]="mkdir -p ";
@@ -14,4 +16,15 @@ unsigned char dir_exists(char *path){
return 1;
}
return 0;
-} \ No newline at end of file
+}
+
+void askforbreak(char *break_file){
+ FILE * file;
+ file = fopen(break_file, "r");
+ while(file){
+ printf("I am doing a break for %ds\n", BREAK_DURATION);
+ sleep(BREAK_DURATION);
+ fclose(file);
+ file = fopen(break_file, "r");
+ }
+}
diff --git a/src/utils.h b/src/utils.h
index fbade91..6414a54 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -40,3 +40,4 @@
void mkdirp(char *path);
unsigned char dir_exists(char *path);
+void askforbreak(char *break_file);