Skip to content

Commit

Permalink
Fix -debug command line option misbehaviour: forbid stdin redirection…
Browse files Browse the repository at this point in the history
… to a pipe when run as plugin server
  • Loading branch information
theang committed Mar 13, 2016
1 parent a84f4ff commit 9674a30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ func wrappedMain() int {
log.Printf("Built with Go Version: %s", runtime.Version())

// Prepare stdin for plugin usage by switching it to a pipe
setupStdin()
// But do not switch to pipe in plugin
if os.Getenv(plugin.MagicCookieKey) != plugin.MagicCookieValue {
setupStdin()
}

config, err := loadConfig()
if err != nil {
Expand Down

0 comments on commit 9674a30

Please sign in to comment.