]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/socket.c
O_CLOEXEC for SCM_RIGHTS
[net-next-2.6.git] / net / socket.c
index f4530196a70a30c10f87450ad47bdfaa9e28f925..b7111425004656a3e35be074a2372af43da29e6c 100644 (file)
@@ -1939,9 +1939,7 @@ asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg,
        total_len = err;
 
        cmsg_ptr = (unsigned long)msg_sys.msg_control;
-       msg_sys.msg_flags = 0;
-       if (MSG_CMSG_COMPAT & flags)
-               msg_sys.msg_flags = MSG_CMSG_COMPAT;
+       msg_sys.msg_flags = flags & (MSG_CMSG_CLOEXEC|MSG_CMSG_COMPAT);
 
        if (sock->file->f_flags & O_NONBLOCK)
                flags |= MSG_DONTWAIT;