NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/41085: sigaction returns EINVAL instead of -1
The following reply was made to PR lib/41085; it has been noted by GNATS.
From: David Holland <dholland-bugs%netbsd.org@localhost>
To: Matteo Beccati <matteo%beccati.com@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: lib/41085: sigaction returns EINVAL instead of -1
Date: Sat, 28 Mar 2009 19:58:51 +0000
On Sat, Mar 28, 2009 at 07:20:06PM +0000, Matteo Beccati wrote:
> root@epia:~/compile/php-HEAD# gcc -lpthread pn.c
> root@epia:~/compile/php-HEAD# ./a.out
> got 22, errno 12345
Aaaargh....
Index: pthread_sig.c
===================================================================
RCS file: /cvsroot/src/lib/libpthread/Attic/pthread_sig.c,v
retrieving revision 1.47.2.2
diff -u -p -r1.47.2.2 pthread_sig.c
--- pthread_sig.c 16 Sep 2008 18:49:33 -0000 1.47.2.2
+++ pthread_sig.c 28 Mar 2009 19:57:40 -0000
@@ -220,8 +220,10 @@ __sigaction14(int sig, const struct siga
pthread_t self;
int retval;
- if ((sig <= 0) || (sig >= _NSIG))
- return EINVAL;
+ if ((sig <= 0) || (sig >= _NSIG)) {
+ errno = EINVAL;
+ return -1;
+ }
self = pthread__self();
pthread_spinlock(self, &pt_sigacts_lock);
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index