From 827e8dbc3c792ed34b0608c3bd3a4d7b0eedf4f5 Mon Sep 17 00:00:00 2001 From: Michal Zidek Date: Wed, 3 Apr 2013 17:43:01 +0200 Subject: Wrong condition after waitpid. On success, waitpid() returns pid of terminated child, not 0. --- src/tools/nscd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/nscd.c b/src/tools/nscd.c index 365383cb..b9f2ba88 100644 --- a/src/tools/nscd.c +++ b/src/tools/nscd.c @@ -70,7 +70,7 @@ int flush_nscd_cache(enum nscd_db flush_db) errno = 0; ret = waitpid(nscd_pid, &status, 0); } while (ret == -1 && errno == EINTR); - if (ret == 0) { + if (ret > 0) { if (WIFEXITED(status)) { ret = WEXITSTATUS(status); if (ret > 0) { -- cgit