Przeglądaj źródła

- fixed logging to syslog on solaris (on solaris openlog does not reopen the
logs fd even if it's closed [daemonize], closelog must be called before, of course this is not
documented anywhere).

Andrei Pelinescu-Onciul 22 lat temu
rodzic
commit
34592dd540
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      main.c

+ 2 - 0
main.c

@@ -35,6 +35,7 @@
  *  2003-04-08  init_mallocs split into init_{pkg,shm}_mallocs and 
  *               init_shm_mallocs called after cmd. line parsing (andrei)
  *  2003-04-15  added tcp_disable support (andrei)
+ *  2003-05-09  closelog() before openlog to force opening a new fd (needed on solaris) (andrei)
  *
  */
 
@@ -488,6 +489,7 @@ int daemonize(char*  name)
 	};
 	
 	/* close any open file descriptors */
+	closelog();
 	for (r=3;r<MAX_FD; r++){
 			close(r);
 	}