summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/input.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index bff13b443..f79208403 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-06-19  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 41322 + comment: Src/input.c: reduce number of changes in signal
+	queuing/blocking state during shingetline() to improve read speed
+
 	* 41317: Src/exec.c: use heap allocation in getoutputfile() to
 	plug memory leak
 
diff --git a/Src/input.c b/Src/input.c
index 92abaec92..9787dedf6 100644
--- a/Src/input.c
+++ b/Src/input.c
@@ -144,9 +144,10 @@ shingetline(void)
     int q = queue_signal_level();
 
     p = buf;
+    winch_unblock();
+    dont_queue_signals();
     for (;;) {
-	winch_unblock();
-	dont_queue_signals();
+	/* Can't fgets() here because we need to accept '\0' bytes */
 	do {
 	    errno = 0;
 	    c = fgetc(bshin);
@@ -176,7 +177,8 @@ shingetline(void)
 	    ll += p - buf;
 	    line[ll] = '\0';
 	    p = buf;
-	    unqueue_signals();
+	    winch_unblock();
+	    dont_queue_signals();
 	}
     }
 }