From: Sebastien Godard Date: Fri, 7 Jan 2011 12:55:07 +0000 (+0100) Subject: sysstat_panic is now defined only in DEBUG mode. X-Git-Tag: v10.0.0~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cda10982b7fb48c6d41a364bddd71adb210cc5f7;p=sysstat sysstat_panic is now defined only in DEBUG mode. 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. --- diff --git a/CHANGES b/CHANGES index 176316f..fd2eded 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ Changes: xxxx/xx/xx: Version 10.0.0 - Sebastien Godard (sysstat 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 orange.fr) diff --git a/common.c b/common.c index 61746c8..afa217b 100644 --- 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 /* *************************************************************************** diff --git a/common.h b/common.h index 298f51f..1fb225c 100644 --- a/common.h +++ b/common.h @@ -115,8 +115,11 @@ #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 */