Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Nov 1, 2024
1 parent 68bc63a commit f06851e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions private/pkg/execext/execext.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ func (rs *runStartOptions) applyCmd(cmd *exec.Cmd) {
}
// If the user did not specify any stdin, we want to make sure
// the command has access to none, as the default is the default stdin.
//
// Note: This *should* be the same as just having cmd.Stdin = nil, given that
// exec.Cmd documents that Stdin has the same behavior as Stdout/Stderr, namely
// that os.DevNull is used. This has been the case for Stdin since at least 2014.
// However, way back when this package was first introduced, we set up the discardReader
// for some reason, and we can't remember why. We're terrified to change it, as there
// *may* have been some reason to do so. os.DevNull is actually just a string such
// as "/dev/null" on Unix systems, so how Golang actually handles this is somewhat
// unknown. Honestly, I might just want to change Stdout/Stderr to use a discardWriter.
if rs.stdin == nil {
cmd.Stdin = discardReader{}
} else {
Expand Down

0 comments on commit f06851e

Please sign in to comment.