From 2c0c43bb0070682421cff6a0e6b022a490723d8c Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 26 Sep 2017 14:15:24 -0400 Subject: Remove use of EBADMSG Not defined on OpenBSD, doesn't matter much. --- bin/dtch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') 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); } -- cgit 1.4.1