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 {
|
func hasStdin() bool {
|
||||||
fi, err := os.Stdin.Stat()
|
stat, err := os.Stdin.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if fi.Mode()&os.ModeNamedPipe == 0 {
|
|
||||||
return false
|
isPipedFromChrDev := (stat.Mode() & os.ModeCharDevice) == 0
|
||||||
}
|
isPipedFromFIFO := (stat.Mode() & os.ModeNamedPipe) != 0
|
||||||
return true
|
|
||||||
|
return isPipedFromChrDev || isPipedFromFIFO
|
||||||
}
|
}
|
||||||
|
|
||||||
func listSources(options *Options) {
|
func listSources(options *Options) {
|
||||||
|
|
Loading…
Reference in New Issue