summary refs log tree commit diff
path: root/.bin/pbd.c
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2017-05-01 14:59:17 -0400
committerJune McEnroe <programble@gmail.com>2017-05-01 14:59:17 -0400
commit810c6fe543c155a9964b075d7937a76b012c441b (patch)
tree576a67af39b6f5c3a1f3c67f02481676e5c817a8 /.bin/pbd.c
parentUse EX_OK in pbcopy (diff)
downloadsrc-810c6fe543c155a9964b075d7937a76b012c441b.tar.gz
src-810c6fe543c155a9964b075d7937a76b012c441b.zip
Clean up style in pbd
Diffstat (limited to '.bin/pbd.c')
-rwxr-xr-x.bin/pbd.c7
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");