changeset 122:d00adc26d77a noffle

[svn] Do not acquire global lock for prniting help
author enz
date Wed, 19 Jul 2000 20:47:41 +0100
parents a0a96e1021c3
children ec190bad201b
files ChangeLog src/noffle.c
diffstat 2 files changed, 10 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 19 19:20:35 2000 +0100
+++ b/ChangeLog	Wed Jul 19 20:47:41 2000 +0100
@@ -2,10 +2,9 @@
 NOFFLE ChangeLog
 -------------------------------------------------------------------------------
 
-Fri Jul 14 2000 Matija Nalis <mnalis-sf@voyager.hr>
+Wed Jul 19 2000 Markus Enzenberger <markus.enzenberger@t-online.de>
 
- * Added counter for --fetch so one can see how much it is until the
-   end of the transfer.
+ * Do not acquire global lock for prniting help
 
 Fri Jul 14 2000 Matija Nalis <mnalis-sf@voyager.hr>
 
--- 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 )