diff options
author | June McEnroe <june@causal.agency> | 2017-09-26 14:15:24 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2017-09-26 14:17:11 -0400 |
commit | 040bf186f684546ba44d5da51ad5a6eee4ade082 (patch) | |
tree | 450861c83b1866d75df070526346e1b1548a60f3 /bin | |
parent | Simplify bins Makefile (diff) | |
download | src-040bf186f684546ba44d5da51ad5a6eee4ade082.tar.gz src-040bf186f684546ba44d5da51ad5a6eee4ade082.zip |
Remove use of EBADMSG
Not defined on OpenBSD, doesn't matter much.
Diffstat (limited to '')
-rw-r--r-- | bin/dtch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/dtch.c b/bin/dtch.c index c530c146..b92ac650 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); } |