"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dbus/dbus-internals.c" between
dbus-1.13.12.tar.xz and dbus-1.13.14.tar.xz

About: D-Bus is an inter-process communication (IPC) system, allowing multiple, concurrently-running applications to communicate with one another. D-Bus supplies both a system daemon and a per-user-login-session daemon. Development version.

dbus-internals.c  (dbus-1.13.12.tar.xz):dbus-internals.c  (dbus-1.13.14.tar.xz)
skipping to change at line 187 skipping to change at line 187
* Unlocks a global lock * Unlocks a global lock
*/ */
/** /**
* Fixed "out of memory" error message, just to avoid * Fixed "out of memory" error message, just to avoid
* making up a different string every time and wasting * making up a different string every time and wasting
* space. * space.
*/ */
const char *_dbus_no_memory_message = "Not enough memory"; const char *_dbus_no_memory_message = "Not enough memory";
/* Not necessarily thread-safe, but if writes don't propagate between
* threads, the worst that will happen is that we duplicate work in more than
* one thread. */
static dbus_bool_t warn_initted = FALSE; static dbus_bool_t warn_initted = FALSE;
/* Not necessarily thread-safe, but if writes don't propagate between
* threads, the worst that will happen is that warnings get their default
* fatal/non-fatal nature. */
static dbus_bool_t fatal_warnings = FALSE; static dbus_bool_t fatal_warnings = FALSE;
static dbus_bool_t fatal_warnings_on_check_failed = TRUE; static dbus_bool_t fatal_warnings_on_check_failed = TRUE;
static void static void
init_warnings(void) init_warnings(void)
{ {
if (!warn_initted) if (!warn_initted)
{ {
const char *s; const char *s;
s = _dbus_getenv ("DBUS_FATAL_WARNINGS"); s = _dbus_getenv ("DBUS_FATAL_WARNINGS");
skipping to change at line 378 skipping to change at line 385
{ {
verbose = state; verbose = state;
} }
dbus_bool_t _dbus_get_verbose (void) dbus_bool_t _dbus_get_verbose (void)
{ {
return verbose; return verbose;
} }
/** /**
* Low-level function for displaying a string
* for the predefined output channel, which
* can be the Windows debug output port or stderr.
*
* This function must be used instead of
* dbus_verbose(), if a dynamic memory request
* cannot be used to avoid recursive call loops.
*
* @param s string to display
*/
void
_dbus_verbose_raw (const char *s)
{
if (!_dbus_is_verbose_real ())
return;
#ifdef DBUS_USE_OUTPUT_DEBUG_STRING
OutputDebugStringA (s);
#else
fputs (s, stderr);
fflush (stderr);
#endif
}
/**
* Prints a warning message to stderr * Prints a warning message to stderr
* if the user has enabled verbose mode. * if the user has enabled verbose mode.
* This is the real function implementation, * This is the real function implementation,
* use _dbus_verbose() macro in code. * use _dbus_verbose() macro in code.
* *
* @param format printf-style format string. * @param format printf-style format string.
*/ */
void void
_dbus_verbose_real ( _dbus_verbose_real (
#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS #ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
skipping to change at line 425 skipping to change at line 456
#endif #endif
/* Only print pid again if the next line is a new line */ /* Only print pid again if the next line is a new line */
len = strlen (format); len = strlen (format);
if (format[len-1] == '\n') if (format[len-1] == '\n')
need_pid = TRUE; need_pid = TRUE;
else else
need_pid = FALSE; need_pid = FALSE;
va_start (args, format); va_start (args, format);
#ifdef DBUS_USE_OUTPUT_DEBUG_STRING #ifdef DBUS_USE_OUTPUT_DEBUG_STRING
{ {
char buf[1024]; DBusString out = _DBUS_STRING_INIT_INVALID;
strcpy(buf,module_name); const char *message = NULL;
if (!_dbus_string_init (&out))
goto out;
if (!_dbus_string_append (&out, module_name))
goto out;
#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS #ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
sprintf (buf+strlen(buf), "[%s(%d):%s] ",_dbus_file_path_extract_elements_from if (!_dbus_string_append_printf (&out, "[%s(%d):%s] ", _dbus_file_path_extra
_tail(file,2),line,function); ct_elements_from_tail (file, 2), line, function))
goto out;
#endif #endif
vsprintf (buf+strlen(buf),format, args); if (!_dbus_string_append_printf_valist (&out, format, args))
va_end (args); goto out;
OutputDebugStringA(buf); message = _dbus_string_get_const_data (&out);
out:
if (message == NULL)
{
OutputDebugStringA ("Out of memory while formatting verbose message: '")
;
OutputDebugStringA (format);
OutputDebugStringA ("'");
}
else
{
OutputDebugStringA (message);
}
_dbus_string_free (&out);
} }
#else #else
#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS #ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
fprintf (stderr, "[%s(%d):%s] ",_dbus_file_path_extract_elements_from_tail(fil e,2),line,function); fprintf (stderr, "[%s(%d):%s] ",_dbus_file_path_extract_elements_from_tail(fil e,2),line,function);
#endif #endif
vfprintf (stderr, format, args); vfprintf (stderr, format, args);
va_end (args);
fflush (stderr); fflush (stderr);
#endif #endif
va_end (args);
} }
/** /**
* Reinitializes the verbose logging code, used * Reinitializes the verbose logging code, used
* as a hack in dbus-spawn-unix.c so that a child * as a hack in dbus-spawn-unix.c so that a child
* process re-reads its pid * process re-reads its pid
* *
*/ */
void void
_dbus_verbose_reset_real (void) _dbus_verbose_reset_real (void)
skipping to change at line 1005 skipping to change at line 1057
const char *description, const char *description,
DBusTestMemoryFunction func, DBusTestMemoryFunction func,
void *data) void *data)
{ {
n_mallocs += 10; /* fudge factor to ensure reallocs etc. are covered */ n_mallocs += 10; /* fudge factor to ensure reallocs etc. are covered */
while (n_mallocs >= 0) while (n_mallocs >= 0)
{ {
_dbus_set_fail_alloc_counter (n_mallocs); _dbus_set_fail_alloc_counter (n_mallocs);
_dbus_verbose ("\n===\n%s: (will fail malloc %d with %d failures)\n===\n", _dbus_test_diag ("%s: will fail malloc %d and %d that follow",
description, n_mallocs, description, n_mallocs,
_dbus_get_fail_alloc_failures ()); _dbus_get_fail_alloc_failures () - 1);
if (!(* func) (data, FALSE)) if (!(* func) (data, FALSE))
return FALSE; return FALSE;
n_mallocs -= 1; n_mallocs -= 1;
} }
_dbus_set_fail_alloc_counter (_DBUS_INT_MAX); _dbus_set_fail_alloc_counter (_DBUS_INT_MAX);
return TRUE; return TRUE;
 End of changes. 10 change blocks. 
12 lines changed or deleted 65 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)