From eb63ba5039c8afe61210cf2b217ec75b4a86356e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 11 Apr 2003 03:05:58 +0000 Subject: 2003-04-10 Havoc Pennington * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): move all the possible parent failures before we fork, so that we don't fail to create a babysitter after creating the child. * bus/activation.c (bus_activation_activate_service): kill child if we don't successfully complete the activation. --- dbus/dbus-internals.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'dbus/dbus-internals.c') diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 230c8efe..30f47f00 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -174,6 +174,8 @@ _dbus_warn (const char *format, va_end (args); } +static dbus_bool_t verbose_initted = FALSE; + /** * Prints a warning message to stderr * if the user has enabled verbose mode. @@ -188,7 +190,6 @@ _dbus_verbose_real (const char *format, { va_list args; static dbus_bool_t verbose = TRUE; - static dbus_bool_t initted = FALSE; static unsigned long pid; /* things are written a bit oddly here so that @@ -198,11 +199,11 @@ _dbus_verbose_real (const char *format, if (!verbose) return; - if (!initted) + if (!verbose_initted) { verbose = _dbus_getenv ("DBUS_VERBOSE") != NULL; pid = _dbus_getpid (); - initted = TRUE; + verbose_initted = TRUE; if (!verbose) return; } @@ -214,6 +215,18 @@ _dbus_verbose_real (const char *format, va_end (args); } +/** + * Reinitializes the verbose logging code, used + * as a hack in dbus-spawn.c so that a child + * process re-reads its pid + * + */ +void +_dbus_verbose_reset_real (void) +{ + verbose_initted = FALSE; +} + /** * Duplicates a string. Result must be freed with * dbus_free(). Returns #NULL if memory allocation fails. -- cgit