configure.ac: check if "struct ucred" is available
By default, glibc 2.8 hides struct ucred behind the _GNU_SOURCE macro. I don't want to enable that globally, because it may encourage the use of non-portable functions. Test if "struct ucred" is available, and enable _GNU_SOURCE if required. For details about that issue, see glib's bug database: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6545
This commit is contained in:
+2
-2
@@ -97,7 +97,7 @@ static int establishListen(int pf, const struct sockaddr *addrp,
|
||||
if (listen(sock, 5) < 0)
|
||||
FATAL("problems listen'ing: %s\n", strerror(errno));
|
||||
|
||||
#if defined(HAVE_UN) && defined(SO_PASSCRED)
|
||||
#ifdef HAVE_UCRED
|
||||
setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &passcred, sizeof(passcred));
|
||||
#endif
|
||||
|
||||
@@ -265,7 +265,7 @@ void freeAllListenSockets(void)
|
||||
|
||||
static int get_remote_uid(int fd)
|
||||
{
|
||||
#if defined(HAVE_UN) && defined(SO_PEERCRED)
|
||||
#ifdef HAVE_UCRED
|
||||
struct ucred cred;
|
||||
socklen_t len = sizeof (cred);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user