This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
FreeBSD port (39): avoid nscd compilation error
- From: Bruno Haible <bruno at clisp dot org>
- To: Roland McGrath <roland at frob dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 5 Sep 2002 14:11:09 +0200 (CEST)
- Subject: FreeBSD port (39): avoid nscd compilation error
FreeBSD doesn't have SO_PEERCRED, therefore 'struct ucred' is not defined
in <sys/socket.h>, therefore we get a compilation error in nscd/connections.c:
connections.c: In function `handle_request':
connections.c:394: storage size of `caller' isn't known
The fix is trivial.
2002-09-04 Bruno Haible <bruno@clisp.org>
* nscd/connections.c (handle_request): Declare 'caller' inside #if.
diff -r -c3 glibc-20020828.bak/nscd/connections.c glibc-20020828/nscd/connections.c
*** glibc-20020828.bak/nscd/connections.c Sat Jan 19 00:02:25 2002
--- glibc-20020828/nscd/connections.c Fri Aug 30 11:04:32 2002
***************
*** 391,402 ****
}
else
{
- struct ucred caller;
- socklen_t optlen = sizeof (caller);
-
/* Some systems have no SO_PEERCRED implementation. They don't
care about security so we don't as well. */
#ifdef SO_PEERCRED
if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &caller, &optlen) < 0)
{
char buf[256];
--- 391,402 ----
}
else
{
/* Some systems have no SO_PEERCRED implementation. They don't
care about security so we don't as well. */
#ifdef SO_PEERCRED
+ struct ucred caller;
+ socklen_t optlen = sizeof (caller);
+
if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &caller, &optlen) < 0)
{
char buf[256];