summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-23 16:15:12 -0500
committerJune McEnroe <programble@gmail.com>2018-02-23 16:15:12 -0500
commit53e703ee23931cc02f5e4a8b86b5691e95bebdcd (patch)
treeccc9036352227aff45cb86196d0b63b7b6a5f7c2
parentTweak fbatt exit codes (diff)
downloadsrc-53e703ee23931cc02f5e4a8b86b5691e95bebdcd.tar.gz
src-53e703ee23931cc02f5e4a8b86b5691e95bebdcd.zip
Don't bother checking result of close(2) in dtch
-rw-r--r--bin/dtch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bin/dtch.c b/bin/dtch.c
index 41659243..23407386 100644
--- a/bin/dtch.c
+++ b/bin/dtch.c
@@ -124,8 +124,7 @@ static int dtch(int argc, char *argv[]) {
     error = mkdirat(home, ".dtch", 0700);
     if (error && errno != EEXIST) err(EX_CANTCREAT, "%s/.dtch", user->pw_dir);
 
-    error = close(home);
-    if (error) err(EX_IOERR, "%s", user->pw_dir);
+    close(home);
 
     int server = socket(PF_LOCAL, SOCK_STREAM, 0);
     if (server < 0) err(EX_OSERR, "socket");
@@ -163,8 +162,7 @@ static int dtch(int argc, char *argv[]) {
         size = recv(client, &z, sizeof(z), 0);
         if (size < 0) warn("recv(%d)", client);
 
-        error = close(client);
-        if (error) warn("close(%d)", client);
+        close(client);
 
         int status;
         pid_t dead = waitpid(pid, &status, WNOHANG);