diff --git a/ChangeLog b/ChangeLog index 3ae9b0cc4..08c462c84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-12-01 Richard Frith-Macdonald + + * Source/NSObject.m: Fix error setting sigpipe handling where + sigaction is available. + 2003-11-30 Richard Frith-Macdonald * Source/NSNumber.m: Raise exception if user code incorrectly tries diff --git a/Source/NSObject.m b/Source/NSObject.m index e26935bce..a51722cd0 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -877,11 +877,16 @@ GSDescriptionForClassMethod(pcl self, SEL aSel) { struct sigaction act; - if (sigaction(SIGPIPE, 0, &act) == 0 && act.sa_handler == SIG_DFL) + if (sigaction(SIGPIPE, 0, &act) == 0) { - if (sigaction(SIGPIPE, &act, 0) != 0) + if (act.sa_handler == SIG_DFL) { - fprintf(stderr, "Unable to ignore SIGPIPE\n"); + // Not ignored or handled ... so we ignore it. + act.sa_handler = SIG_IGN; + if (sigaction(SIGPIPE, &act, 0) != 0) + { + fprintf(stderr, "Unable to ignore SIGPIPE\n"); + } } } else