summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2017-09-26 14:15:24 -0400
committerJune McEnroe <programble@gmail.com>2017-09-26 14:17:11 -0400
commit2c0c43bb0070682421cff6a0e6b022a490723d8c (patch)
treef8ff772b1a7838bd095277956156024eca694a13
parentSimplify bins Makefile (diff)
downloadsrc-2c0c43bb0070682421cff6a0e6b022a490723d8c.tar.gz
src-2c0c43bb0070682421cff6a0e6b022a490723d8c.zip
Remove use of EBADMSG
Not defined on OpenBSD, doesn't matter much.
Diffstat (limited to '')
-rw-r--r--bin/dtch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/dtch.c b/bin/dtch.c
index 4714f748..5b920a31 100644
--- a/bin/dtch.c
+++ b/bin/dtch.c
@@ -99,8 +99,10 @@ static int recvFd(int sock) {
     if (n < 0) return -1;
 
     struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg);
-    if (!cmsg) { errno = ENOMSG; return -1; }
-    if (cmsg->cmsg_type != SCM_RIGHTS) { errno = EBADMSG; return -1; }
+    if (!cmsg || cmsg->cmsg_type != SCM_RIGHTS) {
+        errno = ENOMSG;
+        return -1;
+    }
 
     return *(int *)CMSG_DATA(cmsg);
 }