[pisa-src] r1502 - trunk/pisacd/cdmain.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Tue, 03 Nov 2009 14:44:14 +0100

Author: tjansen
Date: Tue Nov  3 14:44:13 2009
New Revision: 1502

Log:
Moved CONFIG_PISA_PERFORMANCE check into the functions, so cd_{,de}init are a
bit easier to read.

Modified:
   trunk/pisacd/cdmain.c

Modified: trunk/pisacd/cdmain.c
==============================================================================
--- trunk/pisacd/cdmain.c       Tue Nov  3 12:50:38 2009        (r1501)
+++ trunk/pisacd/cdmain.c       Tue Nov  3 14:44:13 2009        (r1502)
@@ -309,19 +309,19 @@
        cdconf_read_basic_confs();
 }
 
-#ifdef CONFIG_PISA_PERFORMANCE
-
 /**
  * Initialize performance measurement data structure
  */
 static void cd_perf_init(void)
 {
+#ifdef CONFIG_PISA_PERFORMANCE
        PISA_DEBUG(PL_PREAUTH, "Creating the performance set.\n");
        pisa_perf = pisa_perf_create(PERF_MAX);
 
        pisa_check_and_create_dir(PISA_DIR_PERF_RESULTS, 
DEFAULT_CONFIG_DIR_MODE);
 
        pisa_perf_open(pisa_perf);
+#endif /* CONFIG_PISA_PERFORMANCE */
 }
 
 /**
@@ -329,10 +329,10 @@
  */
 static void cd_perf_destroy(void)
 {
+#ifdef CONFIG_PISA_PERFORMANCE
        pisa_perf_destroy(pisa_perf);
-}
-
 #endif /* CONFIG_PISA_PERFORMANCE */
+}
 
 /**
  * Initialize the basic settings before starting the main loop.
@@ -366,9 +366,7 @@
                exit(EXIT_FAILURE);
        }
 
-#ifdef CONFIG_PISA_PERFORMANCE
        cd_perf_init();
-#endif
 
        /* set the default or command line specified debug level */
        cdconf_set_debuglevel();
@@ -446,9 +444,7 @@
        /* Remove lockfile */
        pisa_remove_lock_file(PISACD_LOCK_FILE);
 
-#ifdef CONFIG_PISA_PERFORMANCE
        cd_perf_destroy();
-#endif
 }
 
 /**

Other related posts:

  • » [pisa-src] r1502 - trunk/pisacd/cdmain.c - Thomas Jansen