Rename no_daemon to daemon_mode to ditch the double negatives in if conditions.
authorFabian Keil <fk@fabiankeil.de>
Sun, 3 Jan 2010 12:37:14 +0000 (12:37 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 3 Jan 2010 12:37:14 +0000 (12:37 +0000)
errlog.c
jcc.c
jcc.h
loadcfg.c

index ca2a4e5..4fd822b 100644 (file)
--- 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 $
 /*********************************************************************
  *
  * 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
       fclose(logfp);
    }
 #ifdef unix
-   if (!no_daemon && (logfp == stderr))
+   if (daemon_mode && (logfp == stderr))
    {
       if (dup2(1, 2) == -1)
       {
    {
       if (dup2(1, 2) == -1)
       {
diff --git a/jcc.c b/jcc.c
index c8bc3ac..20647fa 100644 (file)
--- 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 $
 /*********************************************************************
  *
  * 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;
 
 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];
 
 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);
       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)
       }
 
       else if (strcmp(argv[argc_pos], "--pidfile" ) == 0)
@@ -3119,7 +3119,7 @@ int main(int argc, char **argv)
 {
    pid_t pid = 0;
 
 {
    pid_t pid = 0;
 
-   if (!no_daemon)
+   if (daemon_mode)
    {
       int fd;
 
    {
       int fd;
 
@@ -3190,7 +3190,7 @@ int main(int argc, char **argv)
 
       chdir("/");
 
 
       chdir("/");
 
-   } /* -END- if (!no_daemon) */
+   } /* -END- if (daemon_mode) */
 
    /*
     * As soon as we have written the PID file, we can switch
 
    /*
     * As soon as we have written the PID file, we can switch
diff --git a/jcc.h b/jcc.h
index 46b1f30..dc97b0a 100644 (file)
--- a/jcc.h
+++ b/jcc.h
@@ -1,6 +1,6 @@
 #ifndef JCC_H_INCLUDED
 #define JCC_H_INCLUDED
 #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 $
 /*********************************************************************
  *
  * 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
 #ifdef unix
 extern const char *pidfile;
 #endif
-extern int no_daemon;
+extern int daemon_mode;
 
 #ifdef FEATURE_GRACEFUL_TERMINATION
 extern int g_terminate;
 
 #ifdef FEATURE_GRACEFUL_TERMINATION
 extern int g_terminate;
index 33e331e..b5512d7 100644 (file)
--- 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 $
 /*********************************************************************
  *
  * 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 :
  * In logdir by default
  * *************************************************************************/
          case hash_logfile :
-            if (!no_daemon)
+            if (daemon_mode)
             {
                logfile = make_path(config->logdir, arg);
                if (NULL == logfile)
             {
                logfile = make_path(config->logdir, arg);
                if (NULL == logfile)
@@ -1331,7 +1331,7 @@ struct configuration_spec * load_config(void)
 
    freez(config->logfile);
 
 
    freez(config->logfile);
 
-   if (!no_daemon)
+   if (daemon_mode)
    {
       if (NULL != logfile)
       {
    {
       if (NULL != logfile)
       {