8a6e4f2
--- ksh-20070328/src/cmd/ksh93/sh/jobs.c.ttou	2007-05-22 12:47:38.000000000 +0200
8a6e4f2
+++ ksh-20070328/src/cmd/ksh93/sh/jobs.c	2007-05-22 12:50:24.000000000 +0200
8a6e4f2
@@ -609,9 +609,16 @@
8a6e4f2
 {
8a6e4f2
 	/* save the terminal state for current job */
8a6e4f2
 #ifdef SIGTSTP
8a6e4f2
+	Sig_handler_t saved_handler;
8a6e4f2
+
8a6e4f2
+	saved_handler = signal(SIGTTOU, SIG_IGN);
8a6e4f2
 	job_fgrp(pw,tcgetpgrp(job.fd));
8a6e4f2
 	if(tcsetpgrp(job.fd,sh.pid) !=0)
8a6e4f2
+	{
8a6e4f2
+		signal(SIGTTOU, saved_handler);
8a6e4f2
 		return;
8a6e4f2
+	}
8a6e4f2
+	signal(SIGTTOU, saved_handler);
8a6e4f2
 #endif	/* SIGTSTP */
8a6e4f2
 	/* force the following tty_get() to do a tcgetattr() */
8a6e4f2
 	tty_set(-1, 0, NIL(struct termios*));