This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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];


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]