source: freewrt/package/osiris/patches/02-osirisd-pidfile.patch@ 428f140

freewrt_1_0 freewrt_2_0
Last change on this file since 428f140 was 475ad56, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

add OpenWrt trunk revision 3830.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@1 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 1.4 KB
  • src/osirisd/osirisd.c

    old new  
    218218
    219219#ifdef USE_PRIVSEP
    220220    rootpriv_setup_pidfile();
     221#else
     222    setup_pidfile();
    221223#endif
    222224
    223225    process();
  • src/osirisd/rootpriv.c

    old new  
    3535#include "logging.h"
    3636#include "rootpriv.h"
    3737
     38#ifndef WIN32
     39extern char pid_file[MAX_PATH_LENGTH];
     40#endif
     41
    3842#ifdef USE_PRIVSEP
    3943
    4044/* this is defined in regex, and sometimes conflicts with stuff */
     
    8084extern pid_t child_pid;
    8185extern int rootpriv_pipe[2];      /* socketpair used for rootpriv comm.  */
    8286
    83 #ifndef WIN32
    84 extern char pid_file[MAX_PATH_LENGTH];
    85 #endif
    86 
    8787#define INCOMING_ROOT_REQUEST() ( FD_ISSET( rootpriv_pipe[1], &root_read_set ) )
    8888
    8989
     
    292292#endif
    293293}
    294294
    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 
    306295void handle_signals()
    307296{
    308297    pid_t pid;
     
    789778
    790779#endif /* USE_PRIVSEP */
    791780
     781void 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.