From: Alan Cox Date: Fri, 29 Sep 2006 09:00:57 +0000 (-0700) Subject: [PATCH] solaris emulation: incorrect tty locking X-Git-Tag: v2.6.19-rc1~716 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de2a84f2be8ed8a166f13d6aa2ae474541172bb2;p=linux-2.6 [PATCH] solaris emulation: incorrect tty locking [akpm@osdl.org: build fix] [akpm@osdl.org: warning fix] Signed-off-by: Alan Cox Acked-by: David S. Miller Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c index 642541769a..9c581328e7 100644 --- a/arch/sparc64/solaris/misc.c +++ b/arch/sparc64/solaris/misc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -422,7 +423,9 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid) Solaris setpgrp and setsid? */ ret = sys_setpgid(0, 0); if (ret) return ret; + mutex_lock(&tty_mutex); current->signal->tty = NULL; + mutex_unlock(&tty_mutex); return process_group(current); } case 2: /* getsid */ diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 142427c6e8..48b59006af 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -129,6 +129,7 @@ LIST_HEAD(tty_drivers); /* linked list of tty drivers */ /* Semaphore to protect creating and releasing a tty. This is shared with vt.c for deeply disgusting hack reasons */ DEFINE_MUTEX(tty_mutex); +EXPORT_SYMBOL(tty_mutex); #ifdef CONFIG_UNIX98_PTYS extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */