system: prevent duplicate Wayland op
All checks were successful
test / test (push) Successful in 36s
All checks were successful
test / test (push) Successful in 36s
Wayland is implemented as an Op to enforce dependency and cleanup, its implementation does not allow multiple instances on a single sys object, nor would doing that make any sense. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
16ab734fcd
commit
f773c92411
@ -32,6 +32,11 @@ func (w Wayland) Type() Enablement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w Wayland) apply(sys *I) error {
|
func (w Wayland) apply(sys *I) error {
|
||||||
|
// the Wayland op is not repeatable
|
||||||
|
if sys.sp != nil {
|
||||||
|
return errors.New("attempted to attach multiple wayland sockets")
|
||||||
|
}
|
||||||
|
|
||||||
if err := w.conn.Attach(w.pair[1]); err != nil {
|
if err := w.conn.Attach(w.pair[1]); err != nil {
|
||||||
return fmsg.WrapErrorSuffix(err,
|
return fmsg.WrapErrorSuffix(err,
|
||||||
fmt.Sprintf("cannot attach to wayland on %q:", w.pair[1]))
|
fmt.Sprintf("cannot attach to wayland on %q:", w.pair[1]))
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// Package wl implements Wayland security_context_v1 protocol.
|
||||||
package wl
|
package wl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Loading…
Reference in New Issue
Block a user