فهرست منبع

Fix daemonize in *nix

z3APA3A 9 سال پیش
والد
کامیت
b242d6df8c
2فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 7 0
      src/common.c
  2. 1 1
      src/proxy.h

+ 7 - 0
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;

+ 1 - 1
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