Merge pull request #336 from vzamanillo/stdin-chardev-fix
Handle data from char device on stdinmaster
commit
acd67aac00
|
@ -116,14 +116,15 @@ func ParseOptions() *Options {
|
|||
}
|
||||
|
||||
func hasStdin() bool {
|
||||
fi, err := os.Stdin.Stat()
|
||||
stat, err := os.Stdin.Stat()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if fi.Mode()&os.ModeNamedPipe == 0 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
isPipedFromChrDev := (stat.Mode() & os.ModeCharDevice) == 0
|
||||
isPipedFromFIFO := (stat.Mode() & os.ModeNamedPipe) != 0
|
||||
|
||||
return isPipedFromChrDev || isPipedFromFIFO
|
||||
}
|
||||
|
||||
func listSources(options *Options) {
|
||||
|
|
Loading…
Reference in New Issue