diff options
-rw-r--r-- | usr.sbin/relayd/buffer.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/usr.sbin/relayd/buffer.c b/usr.sbin/relayd/buffer.c index 60a39d07e05..5af883d1c8c 100644 --- a/usr.sbin/relayd/buffer.c +++ b/usr.sbin/relayd/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.12 2008/03/24 16:11:05 deraadt Exp $ */ +/* $OpenBSD: buffer.c,v 1.13 2008/05/22 08:35:08 gilles Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -203,13 +203,8 @@ msgbuf_write(struct msgbuf *msgbuf) } if (buf != NULL && buf->fd != -1) { - msg.msg_control = (caddr_t)&cmsgbuf.buf; - msg.msg_controllen = sizeof(cmsgbuf.buf); - cmsg = CMSG_FIRSTHDR(&msg); - cmsg->cmsg_len = CMSG_LEN(sizeof(int)); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - *(int *)CMSG_DATA(cmsg) = buf->fd; + close(buf->fd); + buf->fd = -1; } for (buf = TAILQ_FIRST(&msgbuf->bufs); buf != NULL && n > 0; |