diff options
-rw-r--r-- | docs/daemontest.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/daemontest.c b/docs/daemontest.c index 4714822..f0e7393 100644 --- a/docs/daemontest.c +++ b/docs/daemontest.c @@ -29,6 +29,11 @@ #include <fcntl.h> #include <signal.h> #include <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> + #define RUNNING_DIR "/tmp" #define LOCK_FILE "exampled.lock" @@ -87,7 +92,7 @@ char str[10]; signal(SIGTERM,signal_handler); /* catch kill signal */ } -main() +int main() { daemonize(); while(1) sleep(1); /* run */ |