--- /usr/tmp/clean/dbus-1.1.2/bus/bus.c 2007-07-24 19:39:55.000000000 +0100 +++ dbus-1.1.2/bus/bus.c 2008-01-17 15:05:19.697999000 +0000 @@ -726,45 +726,45 @@ goto failed; } } - } - - /* Write PID if requested */ - if (print_pid_pipe != NULL && _dbus_pipe_is_valid (print_pid_pipe)) - { - DBusString pid; - int bytes; - if (!_dbus_string_init (&pid)) + /* Write PID if requested */ + if (print_pid_pipe != NULL && _dbus_pipe_is_valid (print_pid_pipe)) { - BUS_SET_OOM (error); - goto failed; - } + DBusString pid; + int bytes; + + if (!_dbus_string_init (&pid)) + { + BUS_SET_OOM (error); + goto failed; + } - if (!_dbus_string_append_int (&pid, _dbus_getpid ()) || - !_dbus_string_append (&pid, "\n")) - { - _dbus_string_free (&pid); - BUS_SET_OOM (error); - goto failed; - } + if (!_dbus_string_append_int (&pid, _dbus_getpid ()) || + !_dbus_string_append (&pid, "\n")) + { + _dbus_string_free (&pid); + BUS_SET_OOM (error); + goto failed; + } - bytes = _dbus_string_get_length (&pid); - if (_dbus_pipe_write (print_pid_pipe, &pid, 0, bytes, error) != bytes) - { - /* pipe_write sets error on failure but not short write */ - if (error != NULL && !dbus_error_is_set (error)) + bytes = _dbus_string_get_length (&pid); + if (_dbus_pipe_write (print_pid_pipe, &pid, 0, bytes, error) != bytes) { - dbus_set_error (error, DBUS_ERROR_FAILED, - "Printing message bus PID: did not write enough bytes\n"); + /* pipe_write sets error on failure but not short write */ + if (error != NULL && !dbus_error_is_set (error)) + { + dbus_set_error (error, DBUS_ERROR_FAILED, + "Printing message bus PID: did not write enough bytes\n"); + } + _dbus_string_free (&pid); + goto failed; } + + if (!_dbus_pipe_is_stdout_or_stderr (print_pid_pipe)) + _dbus_pipe_close (print_pid_pipe, NULL); + _dbus_string_free (&pid); - goto failed; } - - if (!_dbus_pipe_is_stdout_or_stderr (print_pid_pipe)) - _dbus_pipe_close (print_pid_pipe, NULL); - - _dbus_string_free (&pid); } if (!process_config_postinit (context, parser, error))