From 64a14a3afe5ffea3ee2226e7170677895b651b6f Mon Sep 17 00:00:00 2001
From: oes <oes@users.sourceforge.net>
Date: Thu, 7 Mar 2002 03:52:44 +0000
Subject: [PATCH] Set logging to tty for --no-daemon mode

---
 jcc.h        | 6 +++++-
 junkbuster.1 | 3 ++-
 loadcfg.c    | 7 +++++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/jcc.h b/jcc.h
index cca74902..c233a1a0 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.7 2001/11/05 21:41:43 steudten Exp $"
+#define JCC_H_VERSION "$Id: jcc.h,v 1.8 2002/03/04 18:19:49 oes Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.h,v $
@@ -35,6 +35,9 @@
  *
  * Revisions   :
  *    $Log: jcc.h,v $
+ *    Revision 1.8  2002/03/04 18:19:49  oes
+ *    Added extern const char *pidfile
+ *
  *    Revision 1.7  2001/11/05 21:41:43  steudten
  *    Add changes to be a real daemon just for unix os.
  *    (change cwd to /, detach from controlling tty, set
@@ -93,6 +96,7 @@ extern struct file_list    files[];
 #ifdef unix
 extern const char *pidfile;
 #endif
+extern int no_daemon;
 
 /* Functions */
 
diff --git a/junkbuster.1 b/junkbuster.1
index 87ca5934..227340d6 100644
--- a/junkbuster.1
+++ b/junkbuster.1
@@ -31,7 +31,8 @@ Print a short usage info and exit.
 .TP
 .BR --no-daemon " (unix only)"
 Don't become a daemon, i.e. don't fork and become process group
-leader, don't detach from controlling tty.
+leader, don't detach from controlling tty, and do all logging
+there.
 .TP
 \fB --pidfile\fP \fIPID_FILE\fP (unix only)
 On startup, write the process ID to \fIpidfile\fP. Delete the
diff --git a/loadcfg.c b/loadcfg.c
index fa50a862..03729bf5 100644
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.33 2002/03/05 04:52:42 oes Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.34 2002/03/06 23:14:35 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.33 2002/03/05 04:52:42 oes Exp $"
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.34  2002/03/06 23:14:35  jongfoster
+ *    Trivial cosmetic changes to make function comments easier to find.
+ *
  *    Revision 1.33  2002/03/05 04:52:42  oes
  *    Deleted non-errlog debugging code
  *
@@ -981,7 +984,7 @@ struct configuration_spec * load_config(void)
  * *************************************************************************/
          case hash_logfile :
             freez(config->logfile);
-            config->logfile = make_path(config->logdir, arg);
+            config->logfile = no_daemon ? NULL : make_path(config->logdir, arg);
             continue;
 
 /* *************************************************************************
-- 
2.49.0