Source-Changes-HG archive

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

[src/trunk]: src/etc In the background subshell that flushes partial output e...



details:   https://anonhg.NetBSD.org/src/rev/260f75300281
branches:  trunk
changeset: 797822:260f75300281
user:      apb <apb%NetBSD.org@localhost>
date:      Tue Jul 29 20:39:16 2014 +0000

description:
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.

diffstat:

 etc/rc |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 6ba90266df06 -r 260f75300281 etc/rc
--- a/etc/rc    Tue Jul 29 19:15:47 2014 +0000
+++ b/etc/rc    Tue Jul 29 20:39:16 2014 +0000
@@ -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 @@
        # 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



Home | Main Index | Thread Index | Old Index