Skip to content
Snippets Groups Projects
Commit c7310693 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add copyright notice.

parent 9ea7a42b
Branches
Tags
No related merge requests found
#
# Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
# COPYING RESTRICTIONS APPLY, see COPYRIGHT file
#
all: setup.txt
......
......@@ -603,18 +603,31 @@ set_socket(
exit( 1 );
}
#ifdef SO_REUSEADDR
/* set option so clients can't keep us from coming back up */
i = 1;
i = 1;
if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (void *) &i, sizeof(i) )
< 0 ) {
< 0 )
{
perror( "setsockopt" );
exit( 1 );
}
#endif
#ifdef SO_KEEPALIVE
/* enable keep alives */
i = 1;
if ( setsockopt( s, SOL_SOCKET, SO_KEEPALIVE, (void *) &i, sizeof(i) )
< 0 )
{
perror( "setsockopt" );
exit( 1 );
}
#endif
/* bind to a name */
(void)memset( (void *)&addr, '\0', sizeof( addr ));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons( port );
if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) {
perror( "bind" );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment