* sysdep.c (sys_suspend): Don't try to use "nice (- nice (0))" to
authorJim Blandy <jimb@redhat.com>
Wed, 23 Sep 1992 03:51:13 +0000 (03:51 +0000)
committerJim Blandy <jimb@redhat.com>
Wed, 23 Sep 1992 03:51:13 +0000 (03:51 +0000)
set the subshell's priority to normal; nice doesn't return a
defined value on all systems.  Instead, since emacs_priority gives
the priority that Emacs was nastied to, we can use it to reset the
priority in a straightforward way.
[BSD4_1], [USG], [VMS] (setpriority): Remove dummy and
compatibility definitions of setpriority.

src/sysdep.c

index b8f819d..6197eab 100644 (file)
@@ -604,7 +604,16 @@ sys_suspend ()
 #ifdef subprocesses
       close_process_descs ();  /* Close Emacs's pipes/ptys */
 #endif
-      nice (-nice (0));                /* Give the new shell the default piority */ 
+
+#ifdef PRIO_PROCESS
+      {
+       extern int emacs_priority;
+
+       if (emacs_priority)
+         nice (-emacs_priority);
+      }
+#endif
+
       execlp (sh, sh, 0);
       write (1, "Can't execute subshell", 22);
       _exit (1);
@@ -1772,12 +1781,6 @@ read_input_waiting ()
 #endif /* not VMS */
 \f
 #ifdef BSD4_1
-/* VARARGS */
-setpriority ()
-{
-  return 0;
-}
-
 /*
  * Partially emulate 4.2 open call.
  * open is defined as this in 4.1.
@@ -2369,18 +2372,6 @@ rename (from, to)
 
 #endif
 
-/* Set priority value to PRIO.  */
-
-int
-setpriority (which, who, prio)
-     int which, who, prio;
-{
-  int nice ();
-
-  nice (prio - nice (0));
-  return (0);
-}
-
 #ifndef HAVE_VFORK
 
 /*
@@ -3781,9 +3772,6 @@ delete_logical_name (varname)
 ulimit ()
 {}
 
-setpriority ()
-{}
-
 setpgrp ()
 {}