From 6d153667e57628b502618bb74685b45cca179b9f Mon Sep 17 00:00:00 2001 From: ad Date: Tue, 24 Jun 2008 13:45:07 +0000 Subject: [PATCH] pthread_kill, pthread_sigmask: return errno, not the return from the system call. Found by VSTHlite. --- lib/libpthread/pthread_misc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/libpthread/pthread_misc.c b/lib/libpthread/pthread_misc.c index ec3d3b871e26..671b370dd42e 100644 --- a/lib/libpthread/pthread_misc.c +++ b/lib/libpthread/pthread_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_misc.c,v 1.8 2008/04/28 20:23:01 martin Exp $ */ +/* $NetBSD: pthread_misc.c,v 1.9 2008/06/24 13:45:07 ad Exp $ */ /*- * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: pthread_misc.c,v 1.8 2008/04/28 20:23:01 martin Exp $"); +__RCSID("$NetBSD: pthread_misc.c,v 1.9 2008/06/24 13:45:07 ad Exp $"); #include #include @@ -136,15 +136,18 @@ pthread_kill(pthread_t thread, int sig) return EINVAL; if (pthread__find(thread) != 0) return ESRCH; - - return _lwp_kill(thread->pt_lid, sig); + if (_lwp_kill(thread->pt_lid, sig)) + return errno; + return 0; } int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) { - return _sys___sigprocmask14(how, set, oset); + if (_sys___sigprocmask14(how, set, oset)) + return errno; + return 0; } int