GNU bug report logs -
#13387
emacsclient -t suspends emacs
Previous Next
Reported by: Dan Nicolaescu <dann <at> gnu.org>
Date: Tue, 8 Jan 2013 17:10:01 UTC
Severity: normal
Done: Dan Nicolaescu <dann <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 13387 <at> debbugs.gnu.org (full text, mbox):
Andreas Schwab <schwab <at> linux-m68k.org> writes:
> Dan Nicolaescu <dann <at> 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....
This bug report was last modified 12 years and 180 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.