X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=jcc.c;h=0d52ac628e0c319c32e29f4f49cc5c60b3345d6e;hp=8db61952340ee20194013bc98742b6f6a9a46184;hb=e7d0f5c0644064de7c224adfddf688a9fe5fc386;hpb=6942a9a1a7b7f51b13970a2f84df758b214dead5 diff --git a/jcc.c b/jcc.c index 8db61952..0d52ac62 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.55 2001/11/13 20:14:53 jongfoster Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.57 2001/11/16 00:47:43 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,12 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.55 2001/11/13 20:14:53 jongfoster Exp $"; * * Revisions : * $Log: jcc.c,v $ + * Revision 1.57 2001/11/16 00:47:43 jongfoster + * Changing the tty-disconnection code to use setsid(). + * + * Revision 1.56 2001/11/13 20:20:54 jongfoster + * Tabs->spaces, fixing a bug with missing {} around an if() + * * Revision 1.55 2001/11/13 20:14:53 jongfoster * Patch for FreeBSD setpgrp() as suggested by Alexander Lazic * @@ -1386,7 +1392,7 @@ int main(int argc, const char *argv[]) #elif !defined(_WIN32) "config" #else - "junkbstr.txt" + "config.txt" #endif ; @@ -1481,7 +1487,9 @@ int main(int argc, const char *argv[]) #if defined(unix) { pid_t pid = 0; +#if 0 int fd; +#endif /* * we make us a real daemon @@ -1512,11 +1520,15 @@ int main(int argc, const char *argv[]) exit( 0 ); } /* child */ +#if 1 + /* Should be more portable, but not as well tested */ + setsid(); +#else /* !1 */ #ifdef __FreeBSD__ setpgrp(0,0); -#else +#else /* ndef __FreeBSD__ */ setpgrp(); -#endif +#endif /* ndef __FreeBSD__ */ fd = open("/dev/tty", O_RDONLY); if ( fd ) { @@ -1524,6 +1536,7 @@ int main(int argc, const char *argv[]) ioctl( fd, TIOCNOTTY,0 ); close ( fd ); } +#endif /* !1 */ /* should close stderr (fd 2) here too, but the test for existence ** and load config file is done in listen_loop() and puts ** some messages on stderr there.