From 3f3a53190237034f01d4d798e5dea0b001b16d17 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 12 Mar 2009 10:31:54 -0400 Subject: Always append closing quote in log command Patch suggested by Tomas Hoger --- bus/connection.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'bus') diff --git a/bus/connection.c b/bus/connection.c index ab99fa5f..9159c898 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -575,12 +575,11 @@ cache_peer_loginfo_string (BusConnectionData *d, } if (!_dbus_string_append_printf (&loginfo_buf, "pid=%ld comm=\"", pid)) goto oom; - /* Ignore errors here */ - if (_dbus_command_for_pid (pid, &loginfo_buf, MAX_LOG_COMMAND_LEN, NULL)) - { - if (!_dbus_string_append_byte (&loginfo_buf, '"')) - goto oom; - } + /* Ignore errors here; we may not have permissions to read the + * proc file. */ + _dbus_command_for_pid (pid, &loginfo_buf, MAX_LOG_COMMAND_LEN, NULL); + if (!_dbus_string_append_byte (&loginfo_buf, '"')) + goto oom; } if (dbus_connection_get_windows_user (connection, &windows_sid)) -- cgit