[hackers] [sbase] flock: Check for waitpid() error || sin

From: <git_AT_suckless.org>
Date: Mon, 21 Dec 2015 15:13:41 +0100 (CET)

commit 00d7bf4ea56dd37fe34d6b6aa5a9a1e1dde2abac
Author: sin <sin_AT_2f30.org>
AuthorDate: Mon Dec 21 14:12:09 2015 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Mon Dec 21 14:13:36 2015 +0000

    flock: Check for waitpid() error

diff --git a/flock.c b/flock.c
index 8d015cc..fc2b6ed 100644
--- a/flock.c
+++ b/flock.c
_AT_@ -67,7 +67,8 @@ main(int argc, char *argv[])
         default:
                 break;
         }
- waitpid(pid, &status, 0);
+ if (waitpid(pid, &status, 0) < 0)
+ eprintf("waitpid:");
 
         if (close(fd) < 0)
                 eprintf("close:");
Received on Mon Dec 21 2015 - 15:13:41 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 21 2015 - 15:24:17 CET