]> granicus.if.org Git - sysstat/commitdiff
sysstat_panic is now defined only in DEBUG mode.
authorSebastien Godard <sysstat@orange.fr>
Fri, 7 Jan 2011 12:55:07 +0000 (13:55 +0100)
committerSebastien Godard <sysstat@orange.fr>
Fri, 7 Jan 2011 12:55:07 +0000 (13:55 +0100)
By default, sysstat_panic function is no longer included in binary commands.
This function is defined only if --enable-debuginfo has been used with
configure.

CHANGES
common.c
common.h

diff --git a/CHANGES b/CHANGES
index 176316f5e720a4a8d09f02919eb51d91580ecee6..fd2ededccca2c81cb8e577d5dd4af8e1190119d5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
 Changes:
 
 xxxx/xx/xx: Version 10.0.0 - Sebastien Godard (sysstat <at> orange.fr)
+       * sysstat_panic function is now defined only in DEBUG mode.
        * NLS updated. Ukrainian translation added.
 
 2010/12/26: Version 9.1.7 - Sebastien Godard (sysstat <at> orange.fr)
index 61746c82760bc19d5085d58d5aa0365d8f907712..afa217b0a3ad14ec248feefd1aa434999c0ae820 100644 (file)
--- a/common.c
+++ b/common.c
@@ -564,12 +564,14 @@ unsigned long long get_per_cpu_interval(struct stats_cpu *scc,
  * @error_code Error code.
  ***************************************************************************
  */
+#ifdef DEBUG
 void sysstat_panic(const char *function, int error_code)
 {
        fprintf(stderr, "sysstat: %s[%d]: Last chance handler...\n",
                function, error_code);
        exit(1);
 }
+#endif
 
 /*
  ***************************************************************************
index 298f51fda036cd910526d73052d973876e3b1f8b..1fb225c3c90ca4cb0986b0dd9d55e41cb7a09bc2 100644 (file)
--- a/common.h
+++ b/common.h
 
 #define MINIMUM(a,b)   ((a) < (b) ? (a) : (b))
 
+#ifdef DEBUG
 #define PANIC(m)       sysstat_panic(__FUNCTION__, m)
-
+#else
+#define PANIC(m)
+#endif
 
 /* Number of ticks per second */
 #define HZ             hz
@@ -192,7 +195,9 @@ extern int
        print_gal_header(struct tm *, char *, char *, char *, char *, int);
 extern void
        print_version(void);
+#ifdef DEBUG
 extern void
        sysstat_panic(const char *, int);
+#endif
 
 #endif  /* _COMMON_H */