dbus/dbus dbus-transport-socket.c,1.2,1.3

John Palmieri johnp at kemper.freedesktop.org
Fri Oct 13 14:12:26 PDT 2006


Update of /cvs/dbus/dbus/dbus
In directory kemper:/tmp/cvs-serv18577/dbus

Modified Files:
	dbus-transport-socket.c 
Log Message:
* 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>)



Index: dbus-transport-socket.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-transport-socket.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- dbus-transport-socket.c	16 Sep 2006 19:24:08 -0000	1.2
+++ dbus-transport-socket.c	13 Oct 2006 21:12:24 -0000	1.3
@@ -338,17 +338,23 @@
                       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 @@
     {
       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);
         }
     }



More information about the dbus-commit mailing list