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:
Alejandro Ojeda 2014-10-24 20:04:20 +02:00
parent 863a486d81
commit b7b7524f5f
1 changed files with 10 additions and 12 deletions

View File

@ -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
}