modified devices: filter /dev/console out of...
Applied crosbymichael's suggested changes Signed-off-by: Alejandro Ojeda <alex@x3y.org>
This commit is contained in:
parent
863a486d81
commit
b7b7524f5f
|
@ -100,7 +100,8 @@ func getDeviceNodes(path string) ([]*Device, error) {
|
|||
|
||||
out := []*Device{}
|
||||
for _, f := range files {
|
||||
if f.IsDir() {
|
||||
switch {
|
||||
case f.IsDir():
|
||||
switch f.Name() {
|
||||
case "pts", "shm", "fd":
|
||||
continue
|
||||
|
@ -113,12 +114,10 @@ func getDeviceNodes(path string) ([]*Device, error) {
|
|||
out = append(out, sub...)
|
||||
continue
|
||||
}
|
||||
case f.Name() == "console":
|
||||
continue
|
||||
}
|
||||
|
||||
switch f.Name() {
|
||||
case "console":
|
||||
continue
|
||||
default:
|
||||
device, err := GetDevice(filepath.Join(path, f.Name()), "rwm")
|
||||
if err != nil {
|
||||
if err == ErrNotADeviceNode {
|
||||
|
@ -128,7 +127,6 @@ func getDeviceNodes(path string) ([]*Device, error) {
|
|||
}
|
||||
out = append(out, device)
|
||||
}
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue