diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-15 13:54:03 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-15 13:54:03 +0200 |
| commit | b80973cbd05664dc10a15ae3306726daa335997c (patch) | |
| tree | 1f9910e07e987a30b41d36b445da434bb1cb7e7a /src/publisher.c | |
| parent | a37251135ec3c91b5fb7312d30533111f94263e1 (diff) | |
Minor changes
Diffstat (limited to 'src/publisher.c')
| -rw-r--r-- | src/publisher.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/publisher.c b/src/publisher.c index 0068a56..bc1af69 100644 --- a/src/publisher.c +++ b/src/publisher.c @@ -40,11 +40,11 @@ int main (int argc, char *argv []) } //----- Start publisher - DIR *dr = opendir(__logdir); struct dirent *de; // Pointer for directory entry - for(int i=0;i<=0;i++){ + while(1){ int interval=INTERVAL(__loginterval); int interval_next=INTERVAL_NEXT(__loginterval); + DIR *dr = opendir(__logdir); while ((de = readdir(dr)) != NULL){ if(strcmp(de->d_name,".") && strcmp(de->d_name,"..")){ char *client=de->d_name; @@ -61,12 +61,12 @@ int main (int argc, char *argv []) // Send current one if(FILE_EXISTS(logfile)){ publish(logfile,client,interval); + remove(logfile); } } } + closedir(dr); } - closedir(dr); - zmq_close (publisher); zmq_ctx_destroy (context); @@ -89,5 +89,5 @@ int main (int argc, char *argv []) } void publish(char *filepath, char* client, int interval){ - + printf("Publish!\n"); }
\ No newline at end of file |
