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:
commit
dd492dc15d
4 changed files with 5 additions and 6 deletions
|
@ -446,8 +446,7 @@ func (daemon *Daemon) setupResolvconfWatcher() error {
|
||||||
select {
|
select {
|
||||||
case event := <-watcher.Events:
|
case event := <-watcher.Events:
|
||||||
if event.Name == "/etc/resolv.conf" &&
|
if event.Name == "/etc/resolv.conf" &&
|
||||||
(event.Op&fsnotify.Write == fsnotify.Write ||
|
(event.Op&(fsnotify.Write|fsnotify.Create) != 0) {
|
||||||
event.Op&fsnotify.Create == fsnotify.Create) {
|
|
||||||
// verify a real change happened before we go further--a file write may have happened
|
// verify a real change happened before we go further--a file write may have happened
|
||||||
// without an actual change to the file
|
// without an actual change to the file
|
||||||
updatedResolvConf, newResolvConfHash, err := resolvconf.GetIfChanged()
|
updatedResolvConf, newResolvConfHash, err := resolvconf.GetIfChanged()
|
||||||
|
|
|
@ -162,7 +162,7 @@ func tryRelocate(oldPath, newPath string) error {
|
||||||
}
|
}
|
||||||
// If the destination is a symlink then we already tried to relocate once before
|
// 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
|
// 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 {
|
if err := os.RemoveAll(newPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,8 @@ func setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, st
|
||||||
inode = uint64(s.Ino)
|
inode = uint64(s.Ino)
|
||||||
|
|
||||||
// Currently go does not fil in the major/minors
|
// Currently go does not fil in the major/minors
|
||||||
if s.Mode&syscall.S_IFBLK == syscall.S_IFBLK ||
|
if s.Mode&syscall.S_IFBLK != 0 ||
|
||||||
s.Mode&syscall.S_IFCHR == syscall.S_IFCHR {
|
s.Mode&syscall.S_IFCHR != 0 {
|
||||||
hdr.Devmajor = int64(major(uint64(s.Rdev)))
|
hdr.Devmajor = int64(major(uint64(s.Rdev)))
|
||||||
hdr.Devminor = int64(minor(uint64(s.Rdev)))
|
hdr.Devminor = int64(minor(uint64(s.Rdev)))
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ func (info *FileInfo) path() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (info *FileInfo) isDir() bool {
|
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) {
|
func (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {
|
||||||
|
|
Loading…
Reference in a new issue