1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #11702 from jimmypuckett/feature/bitflag_checking_style_11668

Feature/bitflag checking style 11668.  Fixes #11668
This commit is contained in:
Alexander Morozov 2015-03-26 08:34:58 -07:00
commit dd492dc15d
4 changed files with 5 additions and 6 deletions

View file

@ -446,8 +446,7 @@ 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|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()

View file

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

View file

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

View file

@ -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) {