ignore SIGPIPE

This commit is contained in:
Kurt Zeilenga 1999-01-20 22:01:14 +00:00
parent eed7408e7e
commit 52ca931b70
13 changed files with 61 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/ctype.h>
@ -185,6 +186,10 @@ main ( int argc, char **argv )
identity = MAIL500;
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
#ifdef LOG_MAIL
openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
#else

View File

@ -110,6 +110,10 @@ main( int argc, char **argv )
exit( -1 );
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
perror( "ldap_open" );
exit( -1 );

View File

@ -123,6 +123,10 @@ main( int argc, char **argv )
else
myname = strdup( myname + 1 );
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if ( dosyslog ) {
#ifdef LOG_LOCAL4
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL4 );

View File

@ -172,7 +172,11 @@ main( int argc, char **argv )
lber_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if ( dosyslog ) {
#ifdef LOG_LOCAL3
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );

View File

@ -192,12 +192,15 @@ main (int argc, char **argv )
else
myname = strdup( myname + 1 );
if ( debug ) {
lber_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if ( dosyslog ) {
#ifdef LOG_LOCAL3
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );

View File

@ -16,6 +16,7 @@
#include <stdlib.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
@ -166,6 +167,10 @@ main ( int argc, char **argv )
else
myname = strdup( myname + 1 );
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
#ifdef LOG_MAIL
openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
#else

View File

@ -12,6 +12,7 @@
#include <stdlib.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/unistd.h>
@ -114,6 +115,10 @@ main( int argc, char **argv )
exit( 1 );
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if ( dosyslog ) {
/*
* if syslogging requested, initialize

View File

@ -6,6 +6,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/unistd.h>
@ -117,6 +118,10 @@ main( int argc, char **argv )
ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug );
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
perror( "ldap_open" );
exit( 1 );

View File

@ -6,6 +6,7 @@
#include <stdlib.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/unistd.h>
@ -178,6 +179,10 @@ main( int argc, char **argv )
ldif_debug = debug;
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if ( !not ) {
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
perror( "ldap_open" );

View File

@ -6,6 +6,7 @@
#include <stdlib.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/unistd.h>
@ -141,6 +142,10 @@ main(int argc, char **argv)
ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug );
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
perror( "ldap_open" );
exit( 1 );

View File

@ -20,6 +20,7 @@
#include <stdlib.h>
#include <sys/time.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/unistd.h>
@ -562,6 +563,10 @@ main (int argc, char *argv[])
ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug );
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
/* connect to server */
if ((ld = ldap_open (ldaphost, ldapport)) == NULL)
{

View File

@ -4,6 +4,7 @@
#include <stdlib.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/unistd.h>
@ -263,6 +264,10 @@ main( int argc, char **argv )
ldif_debug = debug;
}
#ifdef SIGPIPE
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if (( ld = ldap_open( ldaphost, ldapport )) == NULL ) {
perror( ldaphost );
exit( 1 );

View File

@ -150,6 +150,10 @@ main( int argc, char **argv )
printf(Version);
fflush( stdout );
#ifdef SIGPIPE
(void) SIGNAL (SIGPIPE, SIG_IGN);
#endif
initialize_client();
initialize_attribute_strings();