From: Fabian Keil Date: Sun, 3 Jan 2010 12:37:14 +0000 (+0000) Subject: Rename no_daemon to daemon_mode to ditch the double negatives in if conditions. X-Git-Tag: v_3_0_16~84 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=140da2f315c69184c96dc753c8d1ae872f19cfc2 Rename no_daemon to daemon_mode to ditch the double negatives in if conditions. --- diff --git a/errlog.c b/errlog.c index ca2a4e58..4fd822b0 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.98 2009/07/08 23:18:05 ler762 Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.99 2009/12/26 11:34:01 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -343,7 +343,7 @@ void init_error_log(const char *prog_name, const char *logfname) fclose(logfp); } #ifdef unix - if (!no_daemon && (logfp == stderr)) + if (daemon_mode && (logfp == stderr)) { if (dup2(1, 2) == -1) { diff --git a/jcc.c b/jcc.c index c8bc3ace..20647fa7 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.309 2009/12/29 13:15:24 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.310 2009/12/29 13:17:37 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -119,7 +119,7 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.309 2009/12/29 13:15:24 fabiankeil Exp $" const char jcc_h_rcs[] = JCC_H_VERSION; const char project_h_rcs[] = PROJECT_H_VERSION; -int no_daemon = 0; +int daemon_mode = 1; struct client_state clients[1]; struct file_list files[1]; @@ -2951,7 +2951,7 @@ int main(int argc, char **argv) else if (strcmp(argv[argc_pos], "--no-daemon" ) == 0) { set_debug_level(LOG_LEVEL_FATAL | LOG_LEVEL_ERROR | LOG_LEVEL_INFO); - no_daemon = 1; + daemon_mode = 0; } else if (strcmp(argv[argc_pos], "--pidfile" ) == 0) @@ -3119,7 +3119,7 @@ int main(int argc, char **argv) { pid_t pid = 0; - if (!no_daemon) + if (daemon_mode) { int fd; @@ -3190,7 +3190,7 @@ int main(int argc, char **argv) chdir("/"); - } /* -END- if (!no_daemon) */ + } /* -END- if (daemon_mode) */ /* * As soon as we have written the PID file, we can switch diff --git a/jcc.h b/jcc.h index 46b1f301..dc97b0a8 100644 --- a/jcc.h +++ b/jcc.h @@ -1,6 +1,6 @@ #ifndef JCC_H_INCLUDED #define JCC_H_INCLUDED -#define JCC_H_VERSION "$Id: jcc.h,v 1.26 2009/05/16 13:27:20 fabiankeil Exp $" +#define JCC_H_VERSION "$Id: jcc.h,v 1.27 2009/09/10 14:42:01 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.h,v $ @@ -56,7 +56,7 @@ extern struct file_list files[1]; #ifdef unix extern const char *pidfile; #endif -extern int no_daemon; +extern int daemon_mode; #ifdef FEATURE_GRACEFUL_TERMINATION extern int g_terminate; diff --git a/loadcfg.c b/loadcfg.c index 33e331ec..b5512d7c 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.106 2009/09/10 14:45:17 fabiankeil Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.107 2009/11/27 13:46:47 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -965,7 +965,7 @@ struct configuration_spec * load_config(void) * In logdir by default * *************************************************************************/ case hash_logfile : - if (!no_daemon) + if (daemon_mode) { logfile = make_path(config->logdir, arg); if (NULL == logfile) @@ -1331,7 +1331,7 @@ struct configuration_spec * load_config(void) freez(config->logfile); - if (!no_daemon) + if (daemon_mode) { if (NULL != logfile) {