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>
This commit is contained in:
parent
e5b018def8
commit
56720a6275
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ static const char *seat_name(struct libseat *base) {
|
||||||
static int open_device(struct libseat *base, const char *path, int *fd) {
|
static int open_device(struct libseat *base, const char *path, int *fd) {
|
||||||
(void)base;
|
(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) {
|
if (tmpfd < 0) {
|
||||||
log_errorf("Failed to open device: %s", strerror(errno));
|
log_errorf("Failed to open device: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue