aboutsummaryrefslogtreecommitdiff
path: root/libseat/backend/noop.c
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-03-30 07:58:51 -0300
committerKenny Levinsen <kl@kl.wtf>2023-04-01 15:34:53 +0200
commit56720a6275032ebafc4aed53d03612e5cc9d8ff7 (patch)
tree7840995d6aac09b9c87aaf980b672b235c2f0135 /libseat/backend/noop.c
parente5b018def8a672cf099df4270e9f3f224b51c09b (diff)
noop: Additional open flags for `open(2)`
Matching the functionallity by the seatd open call. O_NONBLOCK is specially important for libseat, otherwise it hangs while trying to drain all events from an input device fd. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'libseat/backend/noop.c')
-rw-r--r--libseat/backend/noop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libseat/backend/noop.c b/libseat/backend/noop.c
index 141ffd9..18f26c3 100644
--- a/libseat/backend/noop.c
+++ b/libseat/backend/noop.c
@@ -52,7 +52,7 @@ static const char *seat_name(struct libseat *base) {
static int open_device(struct libseat *base, const char *path, int *fd) {
(void)base;
- int tmpfd = open(path, O_RDWR | O_CLOEXEC);
+ int tmpfd = open(path, O_RDWR | O_NOCTTY | O_NOFOLLOW | O_CLOEXEC | O_NONBLOCK);
if (tmpfd < 0) {
log_errorf("Failed to open device: %s", strerror(errno));
return -1;