Define LIBGTOP_ENABLE_DEBUG if this parameter is given.

1998-11-11  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (--enable-debug): Define LIBGTOP_ENABLE_DEBUG
	if this parameter is given.
	(--enable-fatal-warnings): New parameter to make all warnings
	fatal; define `LIBGTOP_FATAL_WARNINGS' if given.

	* sysdeps/common/error.c (glibtop_error_r): Use abort () instead
	of exit () if LIBGTOP_ENABLE_DEBUG.
	(glibtop_error_io_r): Likewise.
	(glibtop_warn_r): Call abort () if LIBGTOP_FATAL_WARNINGS.
	(glibtop_warn_io_r): Likewise.

	[NOTE: To get a core dump of the libgtop_server, you need to
	remove all suid/sgid bits and invoke it as a priviledged user.]
This commit is contained in:
Martin Baulig
1998-11-11 16:02:01 +00:00
committed by Martin Baulig
parent d46c6227fb
commit 44b03ba60b
4 changed files with 42 additions and 3 deletions

View File

@@ -1,3 +1,19 @@
1998-11-11 Martin Baulig <martin@home-of-linux.org>
* configure.in (--enable-debug): Define LIBGTOP_ENABLE_DEBUG
if this parameter is given.
(--enable-fatal-warnings): New parameter to make all warnings
fatal; define `LIBGTOP_FATAL_WARNINGS' if given.
* sysdeps/common/error.c (glibtop_error_r): Use abort () instead
of exit () if LIBGTOP_ENABLE_DEBUG.
(glibtop_error_io_r): Likewise.
(glibtop_warn_r): Call abort () if LIBGTOP_FATAL_WARNINGS.
(glibtop_warn_io_r): Likewise.
[NOTE: To get a core dump of the libgtop_server, you need to
remove all suid/sgid bits and invoke it as a priviledged user.]
1998-11-08 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (support): Don't build if not BUILD_GNOME_SUPPORT.

View File

@@ -118,7 +118,6 @@
#undef HAVE_LIBTIFF
#undef HAVE_LIBZ
#undef HAVE_LIBPNG
#undef GNOME_ENABLE_DEBUG
#undef HAVE_GMP2_INCLUDE_DIR
#undef HAVE_GUILE
@@ -144,3 +143,7 @@
/* Define if your have the I4B package. */
#undef HAVE_I4B
#undef HAVE_I4B_ACCT
/* Define to enable debugging. */
#undef LIBGTOP_ENABLE_DEBUG
#undef LIBGTOP_FATAL_WARNINGS

View File

@@ -220,7 +220,9 @@ AC_SUBST(libs_xauth)
dnl For diskusage stuff
GNOME_FILEUTILS_CHECKS
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
dnl Debugging
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(LIBGTOP_ENABLE_DEBUG),)
AC_ARG_ENABLE(fatal-warnings, [ --enable-fatal-warnings make all warnings fatal [debug=no]],AC_DEFINE(LIBGTOP_FATAL_WARNINGS),)
LIBSUPPORT=
SUPPORTINCS=

View File

@@ -45,7 +45,12 @@ glibtop_error_r (glibtop *server, char *format, ...)
fprintf (stderr, "\n");
va_end (ap);
#ifdef LIBGTOP_ENABLE_DEBUG
abort ();
#else
exit (1);
#endif
}
void
@@ -60,7 +65,12 @@ glibtop_error_io_r (glibtop *server, char *format, ...)
fprintf (stderr, ": %s\n", strerror (errno));
va_end (ap);
#ifdef LIBGTOP_ENABLE_DEBUG
abort ();
#else
exit (1);
#endif
}
void
@@ -75,6 +85,10 @@ glibtop_warn_r (glibtop *server, char *format, ...)
fprintf (stderr, "\n");
va_end (ap);
#ifdef LIBGTOP_FATAL_WARNINGS
abort ();
#endif
}
void
@@ -89,4 +103,8 @@ glibtop_warn_io_r (glibtop *server, char *format, ...)
fprintf (stderr, ": %s\n", strerror (errno));
va_end (ap);
#ifdef LIBGTOP_FATAL_WARNINGS
abort ();
#endif
}