Fix condition to detect device type in DeviceFromPath

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-08-03 11:06:54 -07:00
parent 9a01140955
commit 9ed15e94c8
No known key found for this signature in database
GPG Key ID: 40CF16616B361216
1 changed files with 2 additions and 2 deletions

View File

@ -33,9 +33,9 @@ func DeviceFromPath(path, permissions string) (*configs.Device, error) {
mode = stat.Mode
)
switch {
case mode&unix.S_IFBLK != 0:
case mode&unix.S_IFBLK == unix.S_IFBLK:
devType = 'b'
case mode&unix.S_IFCHR != 0:
case mode&unix.S_IFCHR == unix.S_IFCHR:
devType = 'c'
default:
return nil, ErrNotADevice