From: Kurt Zeilenga Date: Wed, 20 Jan 1999 22:01:14 +0000 (+0000) Subject: ignore SIGPIPE X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~732 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=52ca931b70abd5e290e0ed3146a6bdd012be4e59;p=openldap ignore SIGPIPE --- diff --git a/clients/fax500/main.c b/clients/fax500/main.c index 55c94cca29..8d7b938e8f 100644 --- a/clients/fax500/main.c +++ b/clients/fax500/main.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -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 diff --git a/clients/fax500/rp500.c b/clients/fax500/rp500.c index 8f81e70afb..1c7276fd9f 100644 --- a/clients/fax500/rp500.c +++ b/clients/fax500/rp500.c @@ -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 ); diff --git a/clients/finger/main.c b/clients/finger/main.c index e873b2e2ce..87b1a2c9d9 100644 --- a/clients/finger/main.c +++ b/clients/finger/main.c @@ -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 ); diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index 2c32226353..ef624e0430 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -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 ); diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index 4d83b88b6c..d2218f537b 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -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 ); diff --git a/clients/mail500/main.c b/clients/mail500/main.c index 3c4bb7529b..832ea24dc5 100644 --- a/clients/mail500/main.c +++ b/clients/mail500/main.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -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 diff --git a/clients/rcpt500/main.c b/clients/rcpt500/main.c index 346c5fc10d..2ea4d740f2 100644 --- a/clients/rcpt500/main.c +++ b/clients/rcpt500/main.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -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 diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index b43be367da..eac2d12064 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -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 ); diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 6e055ac389..5b18950dc7 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -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" ); diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index 05a4df902f..267cc780cf 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -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 ); diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index b45d133615..d6e079a25c 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -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) { diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 506757c46b..87a5543013 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -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 ); diff --git a/clients/ud/main.c b/clients/ud/main.c index 956ef1be6f..bbd8537e2e 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -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();