about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Src/utils.c b/Src/utils.c
index f5242bbaa..955158831 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -644,11 +644,16 @@ preprompt(void)
     /* If a shell function named "precmd" exists, *
      * then execute it.                           */
     if ((prog = getshfunc("precmd")) != &dummy_eprog) {
-	int osc = sfcontext;
+	/*
+	 * Save stopmsg, since user doesn't get a chance to respond
+	 * to a list of jobs generated in precmd.
+	 */
+	int osc = sfcontext, osm = stopmsg;
 
 	sfcontext = SFC_HOOK;
 	doshfunc("precmd", prog, NULL, 0, 1);
 	sfcontext = osc;
+	stopmsg = osm;
     }
     if (errflag)
 	return;
@@ -1316,12 +1321,13 @@ read_poll(int fd, int *readchar, int polltty)
     int ret = 0;
     long mode = -1;
     char c;
-#ifdef FIONREAD
-    int val;
-#endif
 #ifdef HAVE_SELECT
     fd_set foofd;
     struct timeval expire_tv;
+#else
+#ifdef FIONREAD
+    int val;
+#endif
 #endif
 #ifdef HAS_TIO
     struct ttyinfo ti;