summary refs log tree commit diff
path: root/bin/dtch.c
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-23 17:47:47 -0500
committerJune McEnroe <programble@gmail.com>2018-02-23 17:47:47 -0500
commit1d0db9488b958ef7d800b9ee9be176496be815d3 (patch)
tree9999a9757980ba20c4981f36a6c03793277ca351 /bin/dtch.c
parentClean up pbd (diff)
downloadsrc-1d0db9488b958ef7d800b9ee9be176496be815d3.tar.gz
src-1d0db9488b958ef7d800b9ee9be176496be815d3.zip
Avoid unnecessary FDs in errors
Diffstat (limited to 'bin/dtch.c')
-rw-r--r--bin/dtch.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/dtch.c b/bin/dtch.c
index 23407386..6fe85838 100644
--- a/bin/dtch.c
+++ b/bin/dtch.c
@@ -138,7 +138,7 @@ static int dtch(int argc, char *argv[]) {
     if (error) err(EX_IOERR, "%s", addr.sun_path);
 
     error = fcntl(server, F_SETFD, FD_CLOEXEC);
-    if (error) err(EX_IOERR, "fcntl(%d)", server);
+    if (error) err(EX_IOERR, "fcntl");
 
     int pty;
     pid_t pid = forkpty(&pty, NULL, NULL, NULL);
@@ -154,13 +154,13 @@ static int dtch(int argc, char *argv[]) {
 
     for (;;) {
         int client = accept(server, NULL, NULL);
-        if (client < 0) err(EX_IOERR, "accept(%d)", server);
+        if (client < 0) err(EX_IOERR, "accept");
 
         ssize_t size = sendFd(client, pty);
-        if (size < 0) warn("sendmsg(%d)", client);
+        if (size < 0) warn("sendmsg");
 
         size = recv(client, &z, sizeof(z), 0);
-        if (size < 0) warn("recv(%d)", client);
+        if (size < 0) warn("recv");
 
         close(client);
 
@@ -195,7 +195,7 @@ static int atch(int argc, char *argv[]) {
     if (error) err(EX_NOINPUT, "%s", addr.sun_path);
 
     int pty = recvFd(client);
-    if (pty < 0) err(EX_IOERR, "recvmsg(%d)", client);
+    if (pty < 0) err(EX_IOERR, "recvmsg");
 
     struct winsize window;
     error = ioctl(STDERR_FILENO, TIOCGWINSZ, &window);