diff --git a/src/common.c b/src/common.c index b72cfb9..b6f4b86 100644 --- a/src/common.c +++ b/src/common.c @@ -17,6 +17,13 @@ int randomizer = 1; #ifndef _WIN32 pthread_attr_t pa; + + + void daemonize(void){ + if(fork()) exit(0); + else setsid(); + } + #endif unsigned char **stringtable = NULL; diff --git a/src/proxy.h b/src/proxy.h index 061cfff..7a1c530 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -104,7 +104,7 @@ #define PTHREAD_STACK_MIN 32768 #define sockerror strerror #endif -#define daemonize() {if(fork())exit(0); else setsid();} +void daemonize(void); #define SLEEPTIME 1000 #ifndef O_BINARY #define O_BINARY 0