From: Dan Nicolaescu <dann@gnu.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 13387@debbugs.gnu.org, Paul Eggert <eggert@cs.ucla.edu>
Subject: bug#13387: emacsclient -t suspends emacs
Date: Thu, 10 Jan 2013 08:43:14 -0500 [thread overview]
Message-ID: <yxqwqvlm9vx.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <mvmlic1peas.fsf@hawking.suse.de> (Andreas Schwab's message of "Thu, 10 Jan 2013 10:39:39 +0100")
Andreas Schwab <schwab@linux-m68k.org> writes:
> Dan Nicolaescu <dann@gnu.org> 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....
next prev parent reply other threads:[~2013-01-10 13:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 17:09 bug#13387: emacsclient -t suspends emacs Dan Nicolaescu
2013-01-10 7:04 ` Dan Nicolaescu
2013-01-10 9:39 ` Andreas Schwab
2013-01-10 13:43 ` Dan Nicolaescu [this message]
2013-01-11 2:47 ` Paul Eggert
2013-01-13 20:09 ` Dan Nicolaescu
2013-01-13 20:08 ` Dan Nicolaescu
2013-01-13 20:29 ` Andreas Schwab
2013-01-13 21:03 ` Dan Nicolaescu
2013-01-13 23:08 ` Andreas Schwab
2013-01-13 23:56 ` Dan Nicolaescu
2013-01-14 10:08 ` Andreas Schwab
2013-01-14 18:51 ` Dan Nicolaescu
2013-01-14 22:43 ` Andreas Schwab
2013-01-15 4:38 ` Dan Nicolaescu
2013-01-15 9:12 ` Andreas Schwab
2013-01-21 3:34 ` Dan Nicolaescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yxqwqvlm9vx.fsf@fencepost.gnu.org \
--to=dann@gnu.org \
--cc=13387@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).