summaryrefslogtreecommitdiff
path: root/src/conf_post.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-10-31 10:27:29 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-10-31 10:27:29 -0700
commit322aea6ddf7ec7fd71410d98ec1de69f219aff3e (patch)
tree5efe99d41566350e9793015cde6ebb656e1278e6 /src/conf_post.h
parent220cb2bd70c65041417554cc2dc10edb4a53de5c (diff)
downloademacs-322aea6ddf7ec7fd71410d98ec1de69f219aff3e.tar.gz
Fix crash when using Emacs as commit editor for git.
* callproc.c (setpgrp): Remove macro, as we now use setpgid and it is configured in conf_post.h. (Fcall_process): Don't invoke both setsid and setpgid; the former is enough, if it exists. * callproc.c (Fcall_process, child_setup): * process.c (create_process): Use setpgid. * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes for the real thing. * dispnew.c (init_display): Initialize the foreground group if we are running a tty display. * emacs.c (main): Do not worry about setpgrp; init_display does it now. * lisp.h (init_foreground_group): New decl. * sysdep.c (inherited_pgroup): New static var. (init_foreground_group, tcsetpgrp_without_stopping) (narrow_foreground_group, widen_foreground_group): New functions. (init_sys_modes): Narrow foreground group. (reset_sys_modes): Widen foreground group. Fixes: debbugs:12697
Diffstat (limited to 'src/conf_post.h')
-rw-r--r--src/conf_post.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/conf_post.h b/src/conf_post.h
index aa008107ba6..6056821d4a7 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -112,6 +112,14 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#endif
/* End of gnulib-related stuff. */
+#ifndef HAVE_SETPGID
+# ifdef USG
+# define setpgid(pid, pgid) setpgrp ()
+# else
+# define setpgid(pid, pgid) setpgrp (pid, pgid)
+# endif
+#endif
+
/* Define one of these for easier conditionals. */
#ifdef HAVE_X_WINDOWS
/* We need a little extra space, see ../../lisp/loadup.el and the