dbus/dbus dbus-sysdeps-unix.c,1.14,1.15

John Palmieri johnp at kemper.freedesktop.org
Thu Oct 26 12:01:12 PDT 2006


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

Modified Files:
	dbus-sysdeps-unix.c 
Log Message:
* dbus-sysdeps-unix.c (_dbus_set_local_creds): Clean up the
  LOCAL_CREDS vs CMSGCRED stuff a bit.  Prefer CMSGCRED.  This
  needs to be cleaned up more.

* doc/TODO: Add a todo that *BSD hackers should look at cleaning
  up the CREDS issue.



Index: dbus-sysdeps-unix.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps-unix.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- dbus-sysdeps-unix.c	24 Oct 2006 20:25:01 -0000	1.14
+++ dbus-sysdeps-unix.c	26 Oct 2006 19:01:10 -0000	1.15
@@ -515,7 +515,11 @@
 {
   dbus_bool_t retval = TRUE;
 
-#if defined(LOCAL_CREDS) && !defined(HAVE_CMSGCRED)
+#if defined(HAVE_CMSGCRED)
+  /* NOOP just to make sure only one codepath is used 
+   *      and to prefer CMSGCRED
+   */
+#elif defined(LOCAL_CREDS) 
   int val = on ? 1 : 0;
   if (setsockopt (fd, 0, LOCAL_CREDS, &val, sizeof (val)) < 0)
     {
@@ -828,16 +832,13 @@
 {
   int bytes_written;
   char buf[1] = { '\0' };
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+#if defined(HAVE_CMSGCRED) 
   struct {
 	  struct cmsghdr hdr;
 	  struct cmsgcred cred;
   } cmsg;
   struct iovec iov;
   struct msghdr msg;
-#endif
-
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
   iov.iov_base = buf;
   iov.iov_len = 1;
 
@@ -857,7 +858,7 @@
   
  again:
 
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+#if defined(HAVE_CMSGCRED) 
   bytes_written = sendmsg (server_fd, &msg, 0);
 #else
   bytes_written = write (server_fd, buf, 1);



More information about the dbus-commit mailing list