Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2008-04-25 18:37:36 +0200
committerArthur de Jong <arthur@arthurdejong.org>2008-04-25 18:37:36 +0200
commit830ba4b892e2d4caef944cef92831d6c847b7718 (patch)
tree77f94b1f6f963e5987d48c3466b07fa9b93dac81
parenta6a5ee891df4f69c1a0ef42b74e892d17b4b71d7 (diff)
ignore SIGPIPE in myldap tests
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@699 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--tests/test_myldap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_myldap.c b/tests/test_myldap.c
index 045259a..8d02fc0 100644
--- a/tests/test_myldap.c
+++ b/tests/test_myldap.c
@@ -393,6 +393,7 @@ int main(int argc,char *argv[])
{
char *srcdir;
char fname[100];
+ struct sigaction act;
/* build the name of the file */
srcdir=getenv("srcdir");
if (srcdir==NULL)
@@ -403,6 +404,13 @@ int main(int argc,char *argv[])
cfg_init(fname);
/* partially initialize logging */
log_setdefaultloglevel(LOG_DEBUG);
+ /* ignore SIGPIPE */
+ memset(&act,0,sizeof(struct sigaction));
+ act.sa_handler=SIG_IGN;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags=SA_RESTART|SA_NOCLDSTOP;
+ assert(sigaction(SIGPIPE,&act,NULL)==0);
+ /* do tests */
test_search();
test_get();
test_get_values();