diff --git a/daemon/daemon.go b/daemon/daemon.go index ebb43e2484..f8b4582875 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -445,8 +445,8 @@ func (daemon *Daemon) setupResolvconfWatcher() error { select { case event := <-watcher.Events: if event.Name == "/etc/resolv.conf" && - (event.Op&fsnotify.Write == fsnotify.Write || - event.Op&fsnotify.Create == fsnotify.Create) { + (event.Op&fsnotify.Write != 0 || + event.Op&fsnotify.Create != 0) { // verify a real change happened before we go further--a file write may have happened // without an actual change to the file updatedResolvConf, newResolvConfHash, err := resolvconf.GetIfChanged() diff --git a/daemon/graphdriver/aufs/migrate.go b/daemon/graphdriver/aufs/migrate.go index dda7cb7390..dd61098e8a 100644 --- a/daemon/graphdriver/aufs/migrate.go +++ b/daemon/graphdriver/aufs/migrate.go @@ -162,7 +162,7 @@ func tryRelocate(oldPath, newPath string) error { } // If the destination is a symlink then we already tried to relocate once before // and it failed so we delete it and try to remove - if s != nil && s.Mode()&os.ModeSymlink == os.ModeSymlink { + if s != nil && s.Mode()&os.ModeSymlink != 0 { if err := os.RemoveAll(newPath); err != nil { return err } diff --git a/pkg/archive/archive_unix.go b/pkg/archive/archive_unix.go index cbce65e31d..82c9a82c1a 100644 --- a/pkg/archive/archive_unix.go +++ b/pkg/archive/archive_unix.go @@ -36,8 +36,8 @@ func setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, st inode = uint64(s.Ino) // Currently go does not fil in the major/minors - if s.Mode&syscall.S_IFBLK == syscall.S_IFBLK || - s.Mode&syscall.S_IFCHR == syscall.S_IFCHR { + if s.Mode&syscall.S_IFBLK != 0 || + s.Mode&syscall.S_IFCHR != 0 { hdr.Devmajor = int64(major(uint64(s.Rdev))) hdr.Devminor = int64(minor(uint64(s.Rdev))) } diff --git a/pkg/archive/changes.go b/pkg/archive/changes.go index c3cb4ebe0e..96aff36a3a 100644 --- a/pkg/archive/changes.go +++ b/pkg/archive/changes.go @@ -176,7 +176,7 @@ func (info *FileInfo) path() string { } func (info *FileInfo) isDir() bool { - return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR == syscall.S_IFDIR + return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0 } func (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {