emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100139: Remove BSD_PGRPS.


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100139: Remove BSD_PGRPS.
Date: Tue, 04 May 2010 00:40:53 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100139
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Tue 2010-05-04 00:40:53 -0700
message:
  Remove BSD_PGRPS.
  * s/bsd-common.h (BSD_PGRPS): Remove undef.
  * s/gnu-linux.h (BSD_PGRPS): Remove.
  * term.c (dissociate_if_controlling_tty):
  * sysdep.c (narrow_foreground_group, widen_foreground_group)
  (init_sys_modes, reset_sys_modes):
  * emacs.c (main):
  * callproc.c (Fcall_process, child_setup): Remove code depending
  on BSD_PGRPS.
modified:
  src/ChangeLog
  src/callproc.c
  src/emacs.c
  src/s/bsd-common.h
  src/s/gnu-linux.h
  src/sysdep.c
  src/term.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-05-04 04:00:10 +0000
+++ b/src/ChangeLog     2010-05-04 07:40:53 +0000
@@ -1,5 +1,15 @@
 2010-05-04  Dan Nicolaescu  <address@hidden>
 
+       Remove BSD_PGRPS.
+       * s/bsd-common.h (BSD_PGRPS): Remove undef.
+       * s/gnu-linux.h (BSD_PGRPS): Remove.
+       * term.c (dissociate_if_controlling_tty):
+       * sysdep.c (narrow_foreground_group, widen_foreground_group)
+       (init_sys_modes, reset_sys_modes):
+       * emacs.c (main):
+       * callproc.c (Fcall_process, child_setup): Remove code depending
+       on BSD_PGRPS.
+
        Remove POSIX_SIGNALS.
        * s/usg5-4.h (POSIX_SIGNALS):
        * s/netbsd.h (POSIX_SIGNALS):

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2010-05-03 15:01:21 +0000
+++ b/src/callproc.c    2010-05-04 07:40:53 +0000
@@ -91,7 +91,7 @@
 #endif
 
 #ifdef HAVE_SETPGID
-#if !defined (USG) || defined (BSD_PGRPS)
+#if !defined (USG)
 #undef setpgrp
 #define setpgrp setpgid
 #endif
@@ -581,7 +581,7 @@
 #ifdef HAVE_SETSID
         setsid ();
 #endif
-#if defined (USG) && !defined (BSD_PGRPS)
+#if defined (USG)
         setpgrp ();
 #else
         setpgrp (pid, pid);
@@ -1251,7 +1251,7 @@
 #endif /* not MSDOS */
 #endif /* not WINDOWSNT */
 
-#if defined(USG) && !defined(BSD_PGRPS)
+#if defined(USG)
 #ifndef SETPGRP_RELEASES_CTTY
   setpgrp ();                  /* No arguments but equivalent in this case */
 #endif

=== modified file 'src/emacs.c'
--- a/src/emacs.c       2010-05-02 18:44:04 +0000
+++ b/src/emacs.c       2010-05-04 07:40:53 +0000
@@ -81,7 +81,7 @@
 #endif
 
 #ifdef HAVE_SETPGID
-#if !defined (USG) || defined (BSD_PGRPS)
+#if !defined (USG)
 #undef setpgrp
 #define setpgrp setpgid
 #endif
@@ -193,11 +193,6 @@
    data on the first attempt to change it inside asynchronous code.  */
 int running_asynch_code;
 
-#ifdef BSD_PGRPS
-/* See sysdep.c.  */
-extern int inherited_pgroup;
-#endif
-
 #if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
 /* If non-zero, -d was specified, meaning we're using some window system.  */
 int display_arg;
@@ -1187,17 +1182,9 @@
 
   if (! noninteractive)
     {
-#ifdef BSD_PGRPS
-      if (initialized)
-       {
-         inherited_pgroup = EMACS_GETPGRP (0);
-         setpgrp (0, getpid ());
-       }
-#else
 #if defined (USG5) && defined (INTERRUPT_INPUT)
       setpgrp ();
 #endif
-#endif
 #if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined 
(DOUG_LEA_MALLOC)
       {
        extern void malloc_enable_thread P_ ((void));

=== modified file 'src/s/bsd-common.h'
--- a/src/s/bsd-common.h        2010-03-30 02:47:23 +0000
+++ b/src/s/bsd-common.h        2010-05-04 07:40:53 +0000
@@ -48,9 +48,6 @@
 
 #define SYSV_SYSTEM_DIR
 
-/* POSIX-style pgrp behavior.  */
-#undef BSD_PGRPS
-
 #define UNEXEC unexelf.o
 
 /* If the system's imake configuration file defines `NeedWidePrototypes'

=== modified file 'src/s/gnu-linux.h'
--- a/src/s/gnu-linux.h 2010-05-04 04:00:10 +0000
+++ b/src/s/gnu-linux.h 2010-05-04 07:40:53 +0000
@@ -206,11 +206,6 @@
 #define HAVE_XRMSETDATABASE
 #endif
 
-/* Use BSD process groups, but use setpgid() instead of setpgrp() to
-   actually set a process group. */
-/* Interesting: only GNU/Linux defines this,  but the BSDs do not... */
-/* #define BSD_PGRPS */
-
 #define NARROWPROTO 1
 
 /* Use mmap directly for allocating larger buffers.  */

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2010-05-04 04:00:10 +0000
+++ b/src/sysdep.c      2010-05-04 07:40:53 +0000
@@ -73,7 +73,7 @@
 #include <errno.h>
 
 #ifdef HAVE_SETPGID
-#if !defined (USG) || defined (BSD_PGRPS)
+#if !defined (USG)
 #undef setpgrp
 #define setpgrp setpgid
 #endif
@@ -859,65 +859,7 @@
 #endif /* FASYNC */
 #endif /* F_SETFL */
 #endif /* SIGIO */
-
-/* Saving and restoring the process group of Emacs's terminal.  */
-
-#ifdef BSD_PGRPS
-
-/* The process group of which Emacs was a member when it initially
-   started.
-
-   If Emacs was in its own process group (i.e. inherited_pgroup ==
-   getpid ()), then we know we're running under a shell with job
-   control (Emacs would never be run as part of a pipeline).
-   Everything is fine.
-
-   If Emacs was not in its own process group, then we know we're
-   running under a shell (or a caller) that doesn't know how to
-   separate itself from Emacs (like sh).  Emacs must be in its own
-   process group in order to receive SIGIO correctly.  In this
-   situation, we put ourselves in our own pgroup, forcibly set the
-   tty's pgroup to our pgroup, and make sure to restore and reinstate
-   the tty's pgroup just like any other terminal setting.  If
-   inherited_group was not the tty's pgroup, then we'll get a
-   SIGTTmumble when we try to change the tty's pgroup, and a CONT if
-   it goes foreground in the future, which is what should happen.
-
-   This variable is initialized in emacs.c.  */
-int inherited_pgroup;
-
-/* Split off the foreground process group to Emacs alone.  When we are
-   in the foreground, but not started in our own process group,
-   redirect the tty device handle FD to point to our own process
-   group.  We need to be in our own process group to receive SIGIO
-   properly.  */
-static void
-narrow_foreground_group (int fd)
-{
-  int me = getpid ();
-
-  setpgrp (0, inherited_pgroup);
-#if 0
-  /* XXX inherited_pgroup should not be zero here, but GTK seems to
-     mess this up. */
-  if (! inherited_pgroup)
-    abort ();                   /* Should not happen. */
-#endif
-  if (inherited_pgroup != me)
-      EMACS_SET_TTY_PGRP (fd, &me); /* XXX This only works on the controlling 
tty. */
-  setpgrp (0, me);
-}
-
-/* Set the tty to our original foreground group.  */
-static void
-widen_foreground_group (int fd)
-{
-  if (inherited_pgroup != getpid ())
-    EMACS_SET_TTY_PGRP (fd, &inherited_pgroup);
-  setpgrp (0, inherited_pgroup);
-}
-
-#endif /* BSD_PGRPS */
+
 
 /* Getting and setting emacs_tty structures.  */
 
@@ -1102,15 +1044,6 @@
   if (!tty_out->output)
     return;                     /* The tty is suspended. */
   
-#ifdef BSD_PGRPS
-#if 0
-  /* read_socket_hook is not global anymore.  I think doing this
-     unconditionally will not cause any problems. */
-  if (! read_socket_hook && EQ (Vinitial_window_system, Qnil))
-#endif
-    narrow_foreground_group (fileno (tty_out->input));
-#endif
-
   if (! tty_out->old_tty)
     tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct 
emacs_tty));
       
@@ -1560,9 +1493,6 @@
   dos_ttcooked ();
 #endif
 
-#ifdef BSD_PGRPS
-  widen_foreground_group (fileno (tty_out->input));
-#endif
 }
 
 #ifdef HAVE_PTYS

=== modified file 'src/term.c'
--- a/src/term.c        2010-04-20 13:31:28 +0000
+++ b/src/term.c        2010-05-04 07:40:53 +0000
@@ -3379,7 +3379,7 @@
   EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */
   if (pgid != -1)
     {
-#if defined (USG) && !defined (BSD_PGRPS)
+#if defined (USG)
       setpgrp ();
       no_controlling_tty = 1;
 #elif defined (CYGWIN)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]