patch-2.3.43 linux/fs/open.c

Next file: linux/fs/openpromfs/inode.c
Previous file: linux/fs/ntfs/fs.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/fs/open.c linux/fs/open.c
@@ -898,16 +898,9 @@
  */
 asmlinkage long sys_vhangup(void)
 {
-	int ret = -EPERM;
-
-	if (!capable(CAP_SYS_TTY_CONFIG))
-		goto out;
-	/* If there is a controlling tty, hang it up */
-	lock_kernel();
-	if (current->tty)
+	if (capable(CAP_SYS_TTY_CONFIG)) {
 		tty_vhangup(current->tty);
-	unlock_kernel();
-	ret = 0;
-out:
-	return ret;
+		return 0;
+	}
+	return -EPERM;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)