diff options
author | June McEnroe <programble@gmail.com> | 2017-05-01 14:59:17 -0400 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2017-05-01 14:59:17 -0400 |
commit | 810c6fe543c155a9964b075d7937a76b012c441b (patch) | |
tree | 576a67af39b6f5c3a1f3c67f02481676e5c817a8 /.bin/pbd.c | |
parent | Use EX_OK in pbcopy (diff) | |
download | src-810c6fe543c155a9964b075d7937a76b012c441b.tar.gz src-810c6fe543c155a9964b075d7937a76b012c441b.zip |
Clean up style in pbd
Diffstat (limited to '.bin/pbd.c')
-rwxr-xr-x | .bin/pbd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/.bin/pbd.c b/.bin/pbd.c index b01f80c3..e7b61d12 100755 --- a/.bin/pbd.c +++ b/.bin/pbd.c @@ -23,8 +23,9 @@ static void spawn(const char *cmd, int childFd, int parentFd) { pid_t wait = waitpid(pid, &status, 0); if (wait < 0) err(EX_OSERR, "waitpid"); - if (status) + if (status) { warnx("child %s status %d", cmd, status); + } } else { int fd = dup2(parentFd, childFd); if (fd < 0) err(EX_OSERR, "dup2"); @@ -62,7 +63,9 @@ int main() { ssize_t peek = recv(client, &p, 1, MSG_PEEK); if (peek < 0) err(EX_IOERR, "recv"); - if (peek) spawn("pbcopy", STDIN_FILENO, client); + if (peek) { + spawn("pbcopy", STDIN_FILENO, client); + } error = close(client); if (error) err(EX_IOERR, "close"); |