summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-11-04 19:18:32 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-11-04 19:18:32 -0800
commitdd0333b6155c9c3aabdac9418c005e2e5b4796e7 (patch)
tree6239cffc67b6a7b0e8eb594c22ed92a4cd28b2fc /src/emacs.c
parent8148369cfba2c982a87fb4eb72d024e26e193a03 (diff)
downloademacs-dd0333b6155c9c3aabdac9418c005e2e5b4796e7.tar.gz
Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid.
This removes code that has been obsolete since around 1990. * admin/CPP-DEFINES (HAVE_SETPGID, HAVE_SETSID, SETPGRP_RELEASES_CTTY): Remove; obsolete. * configure.ac (setpgid, setsid): Assume their existence. (AC_FUNC_GETPGRP, SETPGRP_RELEASES_CTTY): Remove; obsolete. * src/callproc.c (Fcall_process): * src/emacs.c (main): * src/process.c (create_process): * src/term.c (dissociate_if_controlling_tty): Assume setsid exists. * src/callproc.c (child_setup): Assume setpgid exists and behaves as per POSIX.1-1988 or later. * src/conf_post.h (setpgid) [!HAVE_SETPGID]: Remove. * src/emacs.c (shut_down_emacs): * src/sysdep.c (sys_suspend, init_foreground_group): Assume getpgrp behaves as per POSIX.1-1998 or later. * src/msdos.c (setpgrp): Remove. (tcgetpgrp, setpgid, setsid): New functions. * src/systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp. * src/term.c (no_controlling_tty): Remove; unused. * src/w32proc.c (setpgrp): Remove. (setsid, tcgetpgrp): New functions. Fixes: debbugs:12800
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 061c4b4b131..f12713b9628 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1101,9 +1101,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
that it is not accessible to programs started from .emacs. */
fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC);
-#ifdef HAVE_SETSID
setsid ();
-#endif
#else /* DOS_NT */
fprintf (stderr, "This platform does not support the -daemon flag.\n");
exit (1);
@@ -1915,7 +1913,7 @@ shut_down_emacs (int sig, Lisp_Object stuff)
/* If we are controlling the terminal, reset terminal modes. */
#ifndef DOS_NT
{
- pid_t pgrp = EMACS_GETPGRP (0);
+ pid_t pgrp = getpgrp ();
pid_t tpgrp = tcgetpgrp (0);
if ((tpgrp != -1) && tpgrp == pgrp)
{