From f0377a641080105502bcd77d059ec698c25f8769 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 6 May 2025 15:07:32 -0400 Subject: add multiple instance warning if the device is busy. --- marsond.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'marsond.c') diff --git a/marsond.c b/marsond.c index f872baf..b94883b 100644 --- a/marsond.c +++ b/marsond.c @@ -235,6 +235,8 @@ int main(int argc, char **argv) { if(ioctl(infd, EVIOCGRAB, 1) >= 0) { debug("grabbed %s", keyboard_dev); } else { + if(errno == EBUSY) + warn("is an instance of %s already running?", self); die("failed to grab %s: %s", keyboard_dev, strerror(errno)); } @@ -272,7 +274,6 @@ int main(int argc, char **argv) { die("UI_DEV_CREATE failed: %s", strerror(errno)); } - /* this must be done while still running as root... */ if(foreground) { lock_memory(); -- cgit v1.2.3