aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/system
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-19 05:41:29 +0900
committerOphestra <cat@gensokyo.uk>2025-11-19 06:37:04 +0900
commitaab92ce3c1c6649e1a22b00ec999a271e71ef291 (patch)
tree3ccfa205103382e9a4cbc225e71ba9f57ac64f94 /internal/system
parenta495e09a8f11041fb23a9587c0dc9f52513a2937 (diff)
internal/wayland: clean up pathname socket
This is cleaner than cleaning up in internal/system as it covers the failure paths. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/system')
-rw-r--r--internal/system/wayland.go4
-rw-r--r--internal/system/wayland_test.go16
2 files changed, 0 insertions, 20 deletions
diff --git a/internal/system/wayland.go b/internal/system/wayland.go
index c9e431e7..8ce13b66 100644
--- a/internal/system/wayland.go
+++ b/internal/system/wayland.go
@@ -3,7 +3,6 @@ package system
import (
"errors"
"fmt"
- "os"
"hakurei.app/container/check"
"hakurei.app/hst"
@@ -63,9 +62,6 @@ func (w *waylandOp) revert(sys *I, _ *Criteria) error {
if w.ctx != nil {
hangupErr = w.ctx.Close()
}
- if err := sys.remove(w.dst.String()); err != nil && !errors.Is(err, os.ErrNotExist) {
- removeErr = err
- }
return newOpError("wayland", errors.Join(hangupErr, removeErr), true)
}
diff --git a/internal/system/wayland_test.go b/internal/system/wayland_test.go
index d31c1179..083cc96e 100644
--- a/internal/system/wayland_test.go
+++ b/internal/system/wayland_test.go
@@ -36,21 +36,6 @@ func TestWaylandOp(t *testing.T) {
call("aclUpdate", stub.ExpectArgs{"/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland", 0xbeef, []acl.Perm{acl.Read, acl.Write, acl.Execute}}, nil, stub.UniqueError(2)),
}, &OpError{Op: "wayland", Err: errors.Join(stub.UniqueError(2), os.ErrInvalid)}, nil, nil},
- {"remove", 0xbeef, 0xff, &waylandOp{nil,
- m("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland"),
- m("/run/user/1971/wayland-0"),
- "org.chromium.Chromium",
- "ebf083d1b175911782d413369b64ce7c",
- }, []stub.Call{
- call("waylandNew", stub.ExpectArgs{m("/run/user/1971/wayland-0"), m("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland"), "org.chromium.Chromium", "ebf083d1b175911782d413369b64ce7c"}, nil, nil),
- call("verbosef", stub.ExpectArgs{"wayland pathname socket on %q via %q", []any{m("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland"), m("/run/user/1971/wayland-0")}}, nil, nil),
- call("chmod", stub.ExpectArgs{"/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland", os.FileMode(0)}, nil, nil),
- call("aclUpdate", stub.ExpectArgs{"/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland", 0xbeef, []acl.Perm{acl.Read, acl.Write, acl.Execute}}, nil, nil),
- }, nil, []stub.Call{
- call("verbosef", stub.ExpectArgs{"hanging up wayland socket on %q", []any{m("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland")}}, nil, nil),
- call("remove", stub.ExpectArgs{"/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland"}, nil, stub.UniqueError(1)),
- }, &OpError{Op: "wayland", Err: errors.Join(stub.UniqueError(1)), Revert: true}},
-
{"success", 0xbeef, 0xff, &waylandOp{nil,
m("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland"),
m("/run/user/1971/wayland-0"),
@@ -63,7 +48,6 @@ func TestWaylandOp(t *testing.T) {
call("aclUpdate", stub.ExpectArgs{"/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland", 0xbeef, []acl.Perm{acl.Read, acl.Write, acl.Execute}}, nil, nil),
}, nil, []stub.Call{
call("verbosef", stub.ExpectArgs{"hanging up wayland socket on %q", []any{m("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland")}}, nil, nil),
- call("remove", stub.ExpectArgs{"/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/wayland"}, nil, nil),
}, nil},
})