FreeBSD port (39): avoid nscd compilation error
Bruno Haible
bruno@clisp.org
Thu Sep 5 05:09:00 GMT 2002
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];
More information about the Libc-alpha
mailing list