X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=jcc.c;h=7e6f93fa7bf2bd25ce853c0eb378d7d1c8861dba;hp=5967b109f33a642ce62218e69fa848f26db448d8;hb=734a597393f1fe7367c1f78ab6ce07fb8db1e767;hpb=91466e7e5eec9e7d25448c46d69d9a6d067c925f diff --git a/jcc.c b/jcc.c index 5967b109..7e6f93fa 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.72 2002/03/05 21:33:45 david__schmidt Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.74 2002/03/06 00:49:31 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,14 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.72 2002/03/05 21:33:45 david__schmidt Exp * * Revisions : * $Log: jcc.c,v $ + * Revision 1.74 2002/03/06 00:49:31 jongfoster + * Fixing warning on Windows + * Making #ifdefs that refer to the same variable consistently + * use #ifdef unix rather than mixing #ifdef unix & #ifndef OS2 + * + * Revision 1.73 2002/03/05 23:57:30 hal9 + * Stray character 's' on line 1618 was breaking build. + * * Revision 1.72 2002/03/05 21:33:45 david__schmidt * - Re-enable OS/2 building after new parms were added * - Fix false out of memory report when resolving CGI templates when no IP @@ -1568,7 +1576,9 @@ int main(int argc, const char *argv[]) #endif { int argc_pos = 0; - struct passwd *pw; +#ifdef unix + struct passwd *pw = NULL; +#endif Argc = argc; Argv = argv; @@ -1603,7 +1613,7 @@ int main(int argc, const char *argv[]) { no_daemon = 1; } -#if !defined(__OS2__) +#if defined(unix) else if (strcmp(argv[argc_pos], "--pidfile" ) == 0) { if (++argc_pos == argc) usage(argv[0]); @@ -1620,7 +1630,7 @@ int main(int argc, const char *argv[]) log_error(LOG_LEVEL_FATAL, "User %s not found.", argv[argc_pos]); } } -#endif /* !defined(__OS2__) */ +#endif /* defined(unix) */ else #endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */ { @@ -1780,7 +1790,7 @@ int main(int argc, const char *argv[]) */ write_pid_file(); - if (setuid(pw->pw_uid)) + if ((NULL != pw) && setuid(pw->pw_uid)) { log_error(LOG_LEVEL_FATAL, "Cannot setuid(): Insufficient permissions."); }