aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix/sigvec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/sigvec.c')
-rw-r--r--sysdeps/posix/sigvec.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/sysdeps/posix/sigvec.c b/sysdeps/posix/sigvec.c
index 7e9aeb3..59d30f2 100644
--- a/sysdeps/posix/sigvec.c
+++ b/sysdeps/posix/sigvec.c
@@ -1,20 +1,20 @@
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <signal.h>
#include <errno.h>
@@ -54,19 +54,19 @@ convert_mask (set, mask)
register int sig;
if (sizeof (*set) == sizeof (mask))
+ *(int *) set = mask;
+ else if (sizeof (*set) == sizeof (unsigned long int))
+ *(unsigned long int *) set = (unsigned int) mask;
+ else
{
- *(int *) set = mask;
- return 0;
- }
-
- if (__sigemptyset (set) < 0)
- return -1;
-
- for (sig = 1; sig < NSIG; ++sig)
- if (mask & sigmask (sig))
- if (__sigaddset (set, sig) < 0)
+ if (__sigemptyset (set) < 0)
return -1;
+ for (sig = 1; sig < NSIG; ++sig)
+ if ((mask & sigmask (sig)) && __sigaddset (set, sig) < 0)
+ return -1;
+ }
+
return 0;
}
@@ -135,6 +135,8 @@ __sigvec (sig, vec, ovec)
if (sizeof (int) == sizeof (sigset_t))
mask = *(int *) &old.sa_mask;
+ else if (sizeof (unsigned long int) == sizeof (sigset_t))
+ mask = *(unsigned long int *) &old.sa_mask;
else
for (i = 1; i < NSIG; ++i)
if (__sigismember(&old.sa_mask, i))