diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-04-14 00:22:54 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-05-20 18:51:46 +0200 |
commit | b6f50476524e9effb624c1c7c76a98615169241e (patch) | |
tree | 2948d3cc90e3d478bbacc5a41280fccd52b8beea | |
parent | 97d35f32806b54160767269da9a538b1cebd23db (diff) |
Make tests for system call failures a little more robustly
-rw-r--r-- | nslcd/nscd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nslcd/nscd.c b/nslcd/nscd.c index c03cae4..da58c2e 100644 --- a/nslcd/nscd.c +++ b/nslcd/nscd.c @@ -178,7 +178,7 @@ int nscd_start_invalidator(void) pid_t cpid; int i; /* set up a pipe for communication */ - if (pipe(pipefds) == -1) + if (pipe(pipefds) < 0) { log_log(LOG_ERR, "pipe() failed: %s", strerror(errno)); return -1; @@ -201,7 +201,7 @@ int nscd_start_invalidator(void) } /* fork a child to perfrom the nscd invalidate commands */ cpid = fork(); - if (cpid == -1) + if (cpid < 0) { log_log(LOG_ERR, "fork() failed: %s", strerror(errno)); close(pipefds[0]); |