diff --git a/pkg/system/filesys_windows.go b/pkg/system/filesys_windows.go index e1d134a5db..b4646277ab 100644 --- a/pkg/system/filesys_windows.go +++ b/pkg/system/filesys_windows.go @@ -130,12 +130,10 @@ func mkdirWithACL(name string, sddl string) error { // by the daemon. This SHOULD be treated as absolute from a docker processing // perspective. func IsAbs(path string) bool { - if !filepath.IsAbs(path) { - if !strings.HasPrefix(path, string(os.PathSeparator)) { - return false - } + if filepath.IsAbs(path) || strings.HasPrefix(path, string(os.PathSeparator)) { + return true } - return true + return false } // The origin of the functions below here are the golang OS and windows packages, diff --git a/pkg/system/path_windows_test.go b/pkg/system/path_windows_test.go index 974707eb71..b94d25104e 100644 --- a/pkg/system/path_windows_test.go +++ b/pkg/system/path_windows_test.go @@ -12,7 +12,7 @@ import ( func TestCheckSystemDriveAndRemoveDriveLetter(t *testing.T) { // Fails if not C drive. _, err := CheckSystemDriveAndRemoveDriveLetter(`d:\`, pathdriver.LocalPathDriver) - if err == nil || (err != nil && err.Error() != "The specified path is not on the system drive (C:)") { + if err == nil || err.Error() != "The specified path is not on the system drive (C:)" { t.Fatalf("Expected error for d:") } diff --git a/pkg/system/process_windows.go b/pkg/system/process_windows.go index 4e70c97b18..09bdfa0ca0 100644 --- a/pkg/system/process_windows.go +++ b/pkg/system/process_windows.go @@ -13,6 +13,6 @@ func IsProcessAlive(pid int) bool { func KillProcess(pid int) { p, err := os.FindProcess(pid) if err == nil { - p.Kill() + _ = p.Kill() } }