Module Name:    src
Committed By:   apb
Date:           Tue Jul 29 20:39:16 UTC 2014

Modified Files:
        src/etc: rc

Log Message:
In the background subshell that flushes partial output every few
seconds, detach from the controlling terminal.  Without this, pressing
control-T (to send SIGINFO from the terminal) would almost always result
in the sleep process printing "about N seconds left of the original 3",
which is useless information.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/etc/rc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc
diff -u src/etc/rc:1.169 src/etc/rc:1.170
--- src/etc/rc:1.169	Sun Jul 27 07:46:46 2014
+++ src/etc/rc	Tue Jul 29 20:39:16 2014
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: rc,v 1.169 2014/07/27 07:46:46 apb Exp $
+# $NetBSD: rc,v 1.170 2014/07/29 20:39:16 apb Exp $
 #
 # rc --
 #	Run the scripts in /etc/rc.d with rcorder, and log output
@@ -127,6 +127,10 @@ rc_real_work()
 	# nevertheless attempt to print prompts and wait for input.
 	#
 	(
+	    # First detach from tty, to avoid intercepting SIGINFO.
+	    eval "exec ${_rc_original_stdout_fd}<&-"
+	    eval "exec ${_rc_original_stderr_fd}<&-"
+	    exec </dev/null >/dev/null 2>&1
 	    while kill -0 $RC_PID ; do
 		print_rc_metadata "nop"
 		sleep 3

Reply via email to