From 9ed15e94c81da3916f4a45e3340e8177d6a18bb7 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Thu, 3 Aug 2017 11:06:54 -0700 Subject: [PATCH] Fix condition to detect device type in DeviceFromPath Signed-off-by: Kenfe-Mickael Laventure --- libcontainer/devices/devices_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/devices/devices_linux.go b/libcontainer/devices/devices_linux.go index 69883205..461dc097 100644 --- a/libcontainer/devices/devices_linux.go +++ b/libcontainer/devices/devices_linux.go @@ -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