* dbus-transport-socket.c (exchange_credentials):
authorJohn (J5) Palmieri <johnp@redhat.com>
Fri, 13 Oct 2006 21:12:24 +0000 (21:12 +0000)
committerJohn (J5) Palmieri <johnp@redhat.com>
Fri, 13 Oct 2006 21:12:24 +0000 (21:12 +0000)
  Print out more detailed errors if reading or sending
  credentials fail (Patch from Julio M. Merino Vidal
  <jmmv at NetBSD dot org>)

ChangeLog
dbus/dbus-transport-socket.c

index 146ac70..7ab2ca7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-10-13  John (J5) Palmieri  <johnp@redhat.com>
 
+       * dbus-transport-socket.c (exchange_credentials):
+       Print out more detailed errors if reading or sending
+       credentials fail (Patch from Julio M. Merino Vidal 
+       <jmmv at NetBSD dot org>)
+
+2006-10-13  John (J5) Palmieri  <johnp@redhat.com>
+
        * configure.in: when checking for posix getpwnam_r assume true
        for cross compiles
 
index 1e9fdc7..183604b 100644 (file)
@@ -338,17 +338,23 @@ exchange_credentials (DBusTransport *transport,
                       dbus_bool_t    do_writing)
 {
   DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
+  DBusError error;
 
+  _dbus_verbose ("exchange_credentials: do_reading = %d, do_writing = %d\n",
+                  do_reading, do_writing);
+
+  dbus_error_init (&error);
   if (do_writing && transport->send_credentials_pending)
     {
       if (_dbus_send_credentials_unix_socket (socket_transport->fd,
-                                              NULL))
+                                              &error))
         {
           transport->send_credentials_pending = FALSE;
         }
       else
         {
-          _dbus_verbose ("Failed to write credentials\n");
+          _dbus_verbose ("Failed to write credentials: %s\n", error.message);
+          dbus_error_free (&error);
           do_io_error (transport);
         }
     }
@@ -357,13 +363,14 @@ exchange_credentials (DBusTransport *transport,
     {
       if (_dbus_read_credentials_unix_socket (socket_transport->fd,
                                               &transport->credentials,
-                                              NULL))
+                                              &error))
         {
           transport->receive_credentials_pending = FALSE;
         }
       else
         {
-          _dbus_verbose ("Failed to read credentials\n");
+          _dbus_verbose ("Failed to read credentials %s\n", error.message);
+          dbus_error_free (&error);
           do_io_error (transport);
         }
     }