Skip to content

Commit ec5e22e

Browse files
committed
Changing bitflag checking style to preferred style. Fixes moby#11668
Signed-off-by: Jimmy Puckett <jimmy.puckett@spinen.com>
1 parent 197a3f0 commit ec5e22e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

daemon/daemon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ func (daemon *Daemon) setupResolvconfWatcher() error {
445445
select {
446446
case event := <-watcher.Events:
447447
if event.Name == "/etc/resolv.conf" &&
448-
(event.Op&fsnotify.Write == fsnotify.Write ||
449-
event.Op&fsnotify.Create == fsnotify.Create) {
448+
(event.Op&fsnotify.Write != 0 ||
449+
event.Op&fsnotify.Create != 0) {
450450
// verify a real change happened before we go further--a file write may have happened
451451
// without an actual change to the file
452452
updatedResolvConf, newResolvConfHash, err := resolvconf.GetIfChanged()

daemon/graphdriver/aufs/migrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func tryRelocate(oldPath, newPath string) error {
162162
}
163163
// If the destination is a symlink then we already tried to relocate once before
164164
// and it failed so we delete it and try to remove
165-
if s != nil && s.Mode()&os.ModeSymlink == os.ModeSymlink {
165+
if s != nil && s.Mode()&os.ModeSymlink != 0 {
166166
if err := os.RemoveAll(newPath); err != nil {
167167
return err
168168
}

pkg/archive/archive_unix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, st
3636
inode = uint64(s.Ino)
3737

3838
// Currently go does not fil in the major/minors
39-
if s.Mode&syscall.S_IFBLK == syscall.S_IFBLK ||
40-
s.Mode&syscall.S_IFCHR == syscall.S_IFCHR {
39+
if s.Mode&syscall.S_IFBLK != 0 ||
40+
s.Mode&syscall.S_IFCHR != 0 {
4141
hdr.Devmajor = int64(major(uint64(s.Rdev)))
4242
hdr.Devminor = int64(minor(uint64(s.Rdev)))
4343
}

pkg/archive/changes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (info *FileInfo) path() string {
176176
}
177177

178178
func (info *FileInfo) isDir() bool {
179-
return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR == syscall.S_IFDIR
179+
return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0
180180
}
181181

182182
func (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {

0 commit comments

Comments
 (0)