Fix -debug command line option misbehaviour: forbid stdin redirection to a pipe when run as plugin server

This commit is contained in:
wrc 2016-03-13 13:14:44 +03:00
parent a84f4fffae
commit 9674a30227
1 changed files with 4 additions and 1 deletions

View File

@ -112,7 +112,10 @@ func wrappedMain() int {
log.Printf("Built with Go Version: %s", runtime.Version()) log.Printf("Built with Go Version: %s", runtime.Version())
// Prepare stdin for plugin usage by switching it to a pipe // Prepare stdin for plugin usage by switching it to a pipe
// But do not switch to pipe in plugin
if os.Getenv(plugin.MagicCookieKey) != plugin.MagicCookieValue {
setupStdin() setupStdin()
}
config, err := loadConfig() config, err := loadConfig()
if err != nil { if err != nil {