source:
freewrt/package/osiris/patches/02-osirisd-pidfile.patch@
428f140
| Last change on this file since 428f140 was 475ad56, checked in by , 20 years ago | |
|---|---|
|
|
| File size: 1.4 KB | |
-
src/osirisd/osirisd.c
old new 218 218 219 219 #ifdef USE_PRIVSEP 220 220 rootpriv_setup_pidfile(); 221 #else 222 setup_pidfile(); 221 223 #endif 222 224 223 225 process(); -
src/osirisd/rootpriv.c
old new 35 35 #include "logging.h" 36 36 #include "rootpriv.h" 37 37 38 #ifndef WIN32 39 extern char pid_file[MAX_PATH_LENGTH]; 40 #endif 41 38 42 #ifdef USE_PRIVSEP 39 43 40 44 /* this is defined in regex, and sometimes conflicts with stuff */ … … 80 84 extern pid_t child_pid; 81 85 extern int rootpriv_pipe[2]; /* socketpair used for rootpriv comm. */ 82 86 83 #ifndef WIN3284 extern char pid_file[MAX_PATH_LENGTH];85 #endif86 87 87 #define INCOMING_ROOT_REQUEST() ( FD_ISSET( rootpriv_pipe[1], &root_read_set ) ) 88 88 89 89 … … 292 292 #endif 293 293 } 294 294 295 void setup_pidfile()296 {297 FILE *pidfile = fopen( pid_file, "wb" );298 299 if( pidfile != NULL )300 {301 fprintf( pidfile, "%ld\n", (long)getpid() );302 fclose( pidfile );303 }304 }305 306 295 void handle_signals() 307 296 { 308 297 pid_t pid; … … 789 778 790 779 #endif /* USE_PRIVSEP */ 791 780 781 void setup_pidfile() 782 { 783 FILE *pidfile = fopen( pid_file, "wb" ); 784 785 if( pidfile != NULL ) 786 { 787 fprintf( pidfile, "%ld\n", (long)getpid() ); 788 fclose( pidfile ); 789 } 790 } 791
Note:
See TracBrowser
for help on using the repository browser.
