diff src/noffle.c @ 122:d00adc26d77a noffle

[svn] Do not acquire global lock for prniting help
author enz
date Wed, 19 Jul 2000 20:47:41 +0100
parents d45b0abe7c79
children 3c71e28c8eef
line wrap: on
line diff
--- a/src/noffle.c	Wed Jul 19 19:20:35 2000 +0100
+++ b/src/noffle.c	Wed Jul 19 20:47:41 2000 +0100
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 165 2000-06-25 18:42:10Z bears $
+  $Id: noffle.c 176 2000-07-19 19:47:41Z enz $
 */
 
 #if HAVE_CONFIG_H
@@ -55,7 +55,7 @@
     Bool queryGrps;
     Bool queryDsc;
     Bool queryTimes;
-    Bool interactive;
+    Bool lockAtStartup;
 } noffle = { FALSE, FALSE, FALSE, TRUE };
 
 static void
@@ -573,13 +573,12 @@
 }
 
 static Bool
-initNoffle( Bool interactive )
+initNoffle( void )
 {
-    Log_init( "noffle", interactive, LOG_NEWS );
+    Log_init( "noffle", noffle.lockAtStartup, LOG_NEWS );
     Cfg_read();
     Log_dbg( "NOFFLE version %s", Cfg_version() );
-    noffle.interactive = interactive;
-    if ( interactive )
+    if ( noffle.lockAtStartup )
         if ( ! Lock_openDatabases() )
             return FALSE;
     enableCorefiles();
@@ -589,7 +588,7 @@
 static void
 closeNoffle( void )
 {
-    if ( noffle.interactive )
+    if ( noffle.lockAtStartup )
       Lock_closeDatabases();
 }
 
@@ -671,7 +670,8 @@
     signal( SIGPIPE, logSignal );
     c = getopt_long( argc, argv, "a:c:C:dD:efghlm:onpq:rRs:S:t:u:v",
                      longOptions, NULL );
-    if ( ! initNoffle( c != 'r' ) )
+    noffle.lockAtStartup = ! ( c == 'r' || c == 'h' );
+    if ( ! initNoffle() )
         return EXIT_FAILURE;
     result = EXIT_SUCCESS;
     switch ( c )