summaryrefslogtreecommitdiff
path: root/pkg/machine/wsl
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-09-10 07:40:39 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-09-10 07:52:00 -0400
commit2c63b8439bbdc09203ea394ad2cf9352830861f0 (patch)
tree39b9d8d061bc248e4dbeb6445c2ad0c99b048ae1 /pkg/machine/wsl
parent2d8417d86a7edf11bce5527f311bb951a651d40e (diff)
downloadpodman-2c63b8439bbdc09203ea394ad2cf9352830861f0.tar.gz
podman-2c63b8439bbdc09203ea394ad2cf9352830861f0.tar.bz2
podman-2c63b8439bbdc09203ea394ad2cf9352830861f0.zip
Fix stutters
Podman adds an Error: to every error message. So starting an error message with "error" ends up being reported to the user as Error: error ... This patch removes the stutter. Also ioutil.ReadFile errors report the Path, so wrapping the err message with the path causes a stutter. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/machine/wsl')
-rw-r--r--pkg/machine/wsl/machine.go2
-rw-r--r--pkg/machine/wsl/util_windows.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/machine/wsl/machine.go b/pkg/machine/wsl/machine.go
index 7e453823f..44b82b823 100644
--- a/pkg/machine/wsl/machine.go
+++ b/pkg/machine/wsl/machine.go
@@ -939,7 +939,7 @@ func (v *MachineVM) Set(_ string, opts machine.SetOptions) ([]error, error) {
if opts.Rootful != nil && v.Rootful != *opts.Rootful {
err := v.setRootful(*opts.Rootful)
if err != nil {
- setErrors = append(setErrors, fmt.Errorf("error setting rootful option: %w", err))
+ setErrors = append(setErrors, fmt.Errorf("setting rootful option: %w", err))
} else {
v.Rootful = *opts.Rootful
}
diff --git a/pkg/machine/wsl/util_windows.go b/pkg/machine/wsl/util_windows.go
index 6613bde1f..67d1bfc5c 100644
--- a/pkg/machine/wsl/util_windows.go
+++ b/pkg/machine/wsl/util_windows.go
@@ -263,19 +263,19 @@ func obtainShutdownPrivilege() error {
var hToken uintptr
if ret, _, err := OpenProcessToken.Call(uintptr(proc), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, uintptr(unsafe.Pointer(&hToken))); ret != 1 {
- return fmt.Errorf("error opening process token: %w", err)
+ return fmt.Errorf("opening process token: %w", err)
}
var privs TokenPrivileges
if ret, _, err := LookupPrivilegeValue.Call(uintptr(0), uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(SeShutdownName))), uintptr(unsafe.Pointer(&(privs.privileges[0].luid)))); ret != 1 {
- return fmt.Errorf("error looking up shutdown privilege: %w", err)
+ return fmt.Errorf("looking up shutdown privilege: %w", err)
}
privs.privilegeCount = 1
privs.privileges[0].attributes = SE_PRIVILEGE_ENABLED
if ret, _, err := AdjustTokenPrivileges.Call(hToken, 0, uintptr(unsafe.Pointer(&privs)), 0, uintptr(0), 0); ret != 1 {
- return fmt.Errorf("error enabling shutdown privilege on token: %w", err)
+ return fmt.Errorf("enabling shutdown privilege on token: %w", err)
}
return nil