--- tac_plus.c.F4.0.4.15 2007-12-13 11:18:39.000000000 -0800 +++ tac_plus.c 2008-06-13 13:12:14.000000000 -0700 @@ -43,7 +43,7 @@ int parse_only = 0; /* exit after verbose parsing */ int childpid = 1; /* child pid, global for unlink(PIDFILE) */ int single = 0; /* single thread (for debugging) */ -int opt_G; /* foreground */ +int opt_G = 0; /* foreground */ int wtmpfd = 0; /* for wtmp file logging */ char *wtmpfile = NULL; char *bind_address = NULL; @@ -396,7 +396,6 @@ if (debug) report(LOG_DEBUG, "Backgrounded"); - } #ifndef REAPCHILD #if SETPGRP_VOID @@ -434,19 +433,21 @@ signal(SIGCHLD, SIG_IGN); #endif /* REAPCHILD */ - /* - * after forking to disassociate; make sure we know we're the mother - * so that we remove our pid file upon exit in die(). - */ - childpid = 1; - - closelog(); /* some systems require this */ - - for (c = 0; c < getdtablesize(); c++) - (void) close(c); - - /* make sure we can still log to syslog now we've closed everything */ - open_logfile(); + /* + * after forking to disassociate; make sure we know we're the mother + * so that we remove our pid file upon exit in die(). + */ + childpid = 1; + + closelog(); /* some systems require this */ + + for (c = 0; c < getdtablesize(); c++) + (void) close(c); + + /* make sure we can still log to syslog now we've closed + * everything */ + open_logfile(); + } } ostream = NULL; @@ -707,7 +708,8 @@ " [-w ]" #endif "\n"); - fprintf(stderr, "\t-g\tsingle thread mode\n" + fprintf(stderr, "\t-G\tstay in foreground; don't detach from tty\n" + "\t-g\tsingle thread mode\n" "\t-h\tdisplay this message\n" "\t-i\tinetd mode\n" "\t-L\tlookup peer addresses for logs\n"