gnome-keyring r1713 - in trunk: . egg



Author: stefw
Date: Thu Apr  2 04:23:58 2009
New Revision: 1713
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1713&view=rev

Log:
Build fix for Clang.

Patch by Ed Schouten.

Modified:
   trunk/ChangeLog
   trunk/egg/egg-unix-credentials.c

Modified: trunk/egg/egg-unix-credentials.c
==============================================================================
--- trunk/egg/egg-unix-credentials.c	(original)
+++ trunk/egg/egg-unix-credentials.c	Thu Apr  2 04:23:58 2009
@@ -50,16 +50,12 @@
 	 * remote PID. */
 #if defined(HAVE_CMSGCRED)
 	struct cmsgcred *cred;
-	const size_t cmsglen = CMSG_LEN (sizeof (struct cmsgcred));
-	const size_t cmsgspace = CMSG_SPACE (sizeof (struct cmsgcred));
 #else /* defined(LOCAL_CREDS) */
 	struct sockcred *cred;
-	const size_t cmsglen = CMSG_LEN (sizeof (struct sockcred));
-	const size_t cmsgspace = CMSG_SPACE (sizeof (struct sockcred));
 #endif
 	union {
 		struct cmsghdr hdr;
-		char cred[cmsgspace];
+		char cred[CMSG_SPACE (sizeof *cred)];
 	} cmsg;
 #endif
 	
@@ -80,7 +76,7 @@
 #if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS)
 	memset (&cmsg, 0, sizeof (cmsg));
 	msg.msg_control = (caddr_t) &cmsg;
-	msg.msg_controllen = cmsgspace;
+	msg.msg_controllen = CMSG_SPACE(sizeof *cred);
 #endif
 
  again:
@@ -102,7 +98,8 @@
 	}
 
 #if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS)
-	if (cmsg.hdr.cmsg_len < cmsglen || cmsg.hdr.cmsg_type != SCM_CREDS) {
+	if (cmsg.hdr.cmsg_len < CMSG_LEN (sizeof *cred) ||
+	    cmsg.hdr.cmsg_type != SCM_CREDS) {
 		fprintf (stderr, "message from recvmsg() was not SCM_CREDS\n");
 		return -1;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]