Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core...
[sfrench/cifs-2.6.git] / ipc / mqueue.c
index 94fd3b08fb77036d35ecd1a337785f1847fe1613..3e84b958186b5d043ef34c706ff4036433f93c8b 100644 (file)
@@ -673,7 +673,7 @@ asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
        if (IS_ERR(name = getname(u_name)))
                return PTR_ERR(name);
 
-       fd = get_unused_fd();
+       fd = get_unused_fd_flags(O_CLOEXEC);
        if (fd < 0)
                goto out_putname;
 
@@ -709,7 +709,6 @@ asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
                goto out_putfd;
        }
 
-       set_close_on_exec(fd, 1);
        fd_install(fd, filp);
        goto out_upsem;
 
@@ -1055,7 +1054,7 @@ retry:
                        }
 
                        timeo = MAX_SCHEDULE_TIMEOUT;
-                       ret = netlink_attachskb(sock, nc, 0, &timeo, NULL);
+                       ret = netlink_attachskb(sock, nc, &timeo, NULL);
                        if (ret == 1)
                                goto retry;
                        if (ret) {