From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#13387: emacsclient -t suspends emacs Date: Thu, 10 Jan 2013 08:43:14 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1357825454 24916 80.91.229.3 (10 Jan 2013 13:44:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Jan 2013 13:44:14 +0000 (UTC) Cc: 13387@debbugs.gnu.org, Paul Eggert To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 10 14:44:31 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TtIQp-0002jt-DC for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jan 2013 14:44:31 +0100 Original-Received: from localhost ([::1]:33073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIQW-0006Lz-Ir for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jan 2013 08:44:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIQR-0006L9-2G for bug-gnu-emacs@gnu.org; Thu, 10 Jan 2013 08:44:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtIQN-0005LN-OT for bug-gnu-emacs@gnu.org; Thu, 10 Jan 2013 08:44:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIQN-0005L6-Lc for bug-gnu-emacs@gnu.org; Thu, 10 Jan 2013 08:44:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TtIQN-0000TC-VI for bug-gnu-emacs@gnu.org; Thu, 10 Jan 2013 08:44:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dan Nicolaescu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jan 2013 13:44:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13387 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13387-submit@debbugs.gnu.org id=B13387.13578254041748 (code B ref 13387); Thu, 10 Jan 2013 13:44:03 +0000 Original-Received: (at 13387) by debbugs.gnu.org; 10 Jan 2013 13:43:24 +0000 Original-Received: from localhost ([127.0.0.1]:53551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TtIPh-0000S6-NO for submit@debbugs.gnu.org; Thu, 10 Jan 2013 08:43:24 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:56045 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TtIPd-0000Rs-FE for 13387@debbugs.gnu.org; Thu, 10 Jan 2013 08:43:19 -0500 Original-Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TtIPa-0005P9-P1; Thu, 10 Jan 2013 08:43:14 -0500 In-Reply-To: (Andreas Schwab's message of "Thu, 10 Jan 2013 10:39:39 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69565 Archived-At: Andreas Schwab writes: > Dan Nicolaescu writes: > >> it replaces setpgid (pid, pid) with setpgid (0, 0) on GNU/Linux. > > Both do exactly the same. Thanks for eliminating that possibility. I can confirm that the problem is caused by this change: @@ -2918,36 +2914,9 @@ set_tty_hooks (struct terminal *terminal static void dissociate_if_controlling_tty (int fd) { -#ifndef DOS_NT pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ - if (pgid != -1) - { -#if defined (USG5) - setpgrp (); - no_controlling_tty = 1; -#elif defined (CYGWIN) - setsid (); - no_controlling_tty = 1; -#else -#ifdef TIOCNOTTY /* Try BSD ioctls. */ - sigset_t blocked; - sigemptyset (&blocked); - sigaddset (&blocked, SIGTTOU); - pthread_sigmask (SIG_BLOCK, &blocked, 0); - fd = emacs_open (DEV_TTY, O_RDWR, 0); - if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1) - { - no_controlling_tty = 1; - } - if (fd != -1) - emacs_close (fd); - pthread_sigmask (SIG_UNBLOCK, &blocked, 0); -#else -# error "Unknown system." -#endif /* ! TIOCNOTTY */ -#endif /* ! USG */ - } -#endif /* !DOS_NT */ + if (0 <= pgid) + setsid (); } /* Create a termcap display on the tty device with the given name and Also I think that the "USG5" case did not work in the original code, I vaguely remember that this problem happened on Solaris a few years ago. I don't have easy access to a Solaris machine to confirm....