summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-04-14 00:22:54 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-05-20 18:51:46 +0200
commitb6f50476524e9effb624c1c7c76a98615169241e (patch)
tree2948d3cc90e3d478bbacc5a41280fccd52b8beea
parent97d35f32806b54160767269da9a538b1cebd23db (diff)
Make tests for system call failures a little more robustly
-rw-r--r--nslcd/nscd.c4
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]);