summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Wiley <brandon@blanu.net>2017-02-09 10:27:51 -0600
committerBrandon Wiley <brandon@blanu.net>2017-02-09 10:27:51 -0600
commit45edeafa9eabf1f6303cd20096480fd86a251d5b (patch)
treede5a786771740354bcd1f429790614427598477d
parent769e5a0b48b23de8ccc0b41eeb3ea5e83c2b1de5 (diff)
Implemented -exit-on-sdin-close flag
-rw-r--r--common/termmon/termmon.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/termmon/termmon.go b/common/termmon/termmon.go
index b95c77d..716bef6 100644
--- a/common/termmon/termmon.go
+++ b/common/termmon/termmon.go
@@ -104,7 +104,7 @@ func (m *TermMonitor) termOnPPIDChange(ppid int) {
m.sigChan <- syscall.SIGTERM
}
-func NewTermMonitor() (m *TermMonitor) {
+func NewTermMonitor(exitOnStdinClose bool) (m *TermMonitor) {
ppid := os.Getppid()
m = new(TermMonitor)
m.sigChan = make(chan os.Signal)
@@ -114,7 +114,7 @@ func NewTermMonitor() (m *TermMonitor) {
// If tor supports feature #15435, we can use Stdin being closed as an
// indication that tor has died, or wants the PT to shutdown for any
// reason.
- if pt_extras.PtShouldExitOnStdinClose() {
+ if exitOnStdinClose || pt_extras.PtShouldExitOnStdinClose() {
go m.termOnStdinClose()
} else {
// Instead of feature #15435, use various kludges and hacks: