Commit Graph

3 Commits

Author SHA1 Message Date
James Bardin cd65b28da0 don't call os.NewFile on unknown FDs
os.NewFile was called on file descriptors 3, 4, and 5 during every init,
in case this process happened to be running inside panicwrap. If the
runtime has already chosen one of these file descriptors to use
internally, starting polling on them can cause the runtime to crash.

Initialize the file descriptors lazily, only if we know that they belong
to us, after Wrapped is checked.
2020-04-04 15:46:19 -04:00
Mitchell Hashimoto fd36b548c5
helper/wrappedstreams: get original console input/output on Windows
Fixes #10266

panicwrap was using Extrafiles to get the original standard streams for
`terraform console`. This doesn't work on Windows. Instead, we must use
the Win32 APIs to get the exact handles.
2016-11-21 10:44:01 -08:00
Mitchell Hashimoto 1a6056b287
command: split out and tag code so compilation works on Solaris
The readline library doesn't support Solaris. For now, we'll just not
support console there.
2016-11-14 00:32:01 -08:00