sigandset/sigorset: do not check for NULL pointers.

that way it's consistent with existing sig* functions, and saves
some code size.
This commit is contained in:
rofl0r 2012-12-06 22:14:37 +01:00
parent 4ab26cc34c
commit 30d2c1f5bf
2 changed files with 0 additions and 10 deletions

View File

@ -1,15 +1,10 @@
#define _GNU_SOURCE
#include <signal.h>
#include <errno.h>
#define SST_SIZE (_NSIG/8)
int sigandset(sigset_t *dest, sigset_t *left, sigset_t *right)
{
if(!dest || !left || !right) {
errno = EINVAL;
return -1;
}
unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
for(; i < SST_SIZE; i++) d[i] = l[i] & r[i];
return 0;

View File

@ -1,15 +1,10 @@
#define _GNU_SOURCE
#include <signal.h>
#include <errno.h>
#define SST_SIZE (_NSIG/8)
int sigorset(sigset_t *dest, sigset_t *left, sigset_t *right)
{
if(!dest || !left || !right) {
errno = EINVAL;
return -1;
}
unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
for(; i < SST_SIZE; i++) d[i] = l[i] | r[i];
return 0;