[Mt-daapd-cvs] mt-daapd/src daapd.h,1.22,1.23 main.c,1.92,1.93
Status: Beta
Brought to you by:
andrew40
From: Ron P. <rp...@us...> - 2005-01-30 06:58:45
|
Update of /cvsroot/mt-daapd/mt-daapd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv591 Modified Files: daapd.h main.c Log Message: fix pidfile for heavyweight threads Index: main.c =================================================================== RCS file: /cvsroot/mt-daapd/mt-daapd/src/main.c,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** main.c 24 Jan 2005 07:42:42 -0000 1.92 --- main.c 30 Jan 2005 06:58:36 -0000 1.93 *************** *** 613,616 **** --- 613,617 ---- config.stop=0; config.reload=0; + config.pid=getpid(); DPRINTF(E_WARN,L_MAIN,"Signal handler started\n"); *************** *** 805,810 **** daemon_start(); ! fprintf(pid_fp,"%d\n",getpid()); ! fclose(pid_fp); } --- 806,811 ---- daemon_start(); ! /* just to be on the safe side... */ ! config.pid=0; } *************** *** 825,828 **** --- 826,838 ---- } + + /* wait to for config.pid to be set by the signal handler */ + while(!config.pid) { + sleep(1); + } + + fprintf(pid_fp,"%d\n",config.pid); + fclose(pid_fp); + DPRINTF(E_LOG,L_MAIN|L_PL,"Loading playlists\n"); Index: daapd.h =================================================================== RCS file: /cvsroot/mt-daapd/mt-daapd/src/daapd.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** daapd.h 29 Dec 2004 05:44:32 -0000 1.22 --- daapd.h 30 Jan 2005 06:58:36 -0000 1.23 *************** *** 56,59 **** --- 56,60 ---- int scan_type; /**< How hard to search mp3 files. see scan_get_mp3fileinfo() */ int compress; /**< Should we compress? */ + int pid; /**< pid that will accept INT to terminate */ char *adminpassword; /**< Password to web management pages */ char *readpassword; /**< iTunes password */ |