Use a pty for prefixed output instead of pipes for stdout/stderr. This

is so that programs can get information about the controlling terminal.
This change was triggered by bug #188506 where it's possible that
stdin, stdout and stderr didn't point to a terminal but ended up on one
via our pipes. Using a pty means that stdout and stderr always point to
a terminal, but we lose the ability to tell them apart.
If there is not a pty available then we use un-prefixed output as normal.
This change has also introduced the need for a signal pipe so that
SIGCHLD can exit the loop cleanly.
This commit is contained in:
Roy Marples
2007-09-21 08:49:43 +00:00
parent ca58877ed0
commit 45bd125dcc
5 changed files with 123 additions and 137 deletions

View File

@@ -59,7 +59,7 @@ LDLIBS_LIBRC = -leinfo
RCOBJS = checkown.o env-update.o fstabinfo.o mountinfo.o \
rc-depend.o rc-plugin.o rc-status.o rc-update.o runscript.o \
start-stop-daemon.o rc.o
LDLIBS_RC = $(LDLIBS_LIBRC) -lrc
LDLIBS_RC = $(LDLIBS_LIBRC) -lrc -lutil
LIB_TARGETS = $(LIBEINFOSO) $(LIBRCSO)
SBIN_TARGETS = rc