Skip to content

Commit

Permalink
Make sure we Enforce CLOEXEC on legacy builds in input_scan
Browse files Browse the repository at this point in the history
Kernels are too old to support it via open flags, so use fcntl there.
  • Loading branch information
NiLuJe committed May 19, 2024
1 parent 68b87b5 commit 012dd73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fbink_input_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ FBInkInputDevice*
free(namelist[i]);
continue;
}
# ifdef FBINK_FOR_LEGACY
// Enforce CLOEXEC the hard way on legacy devices with kernels too old to support it via open flags.
int fdflags = fcntl(dev->fd, F_GETFD);
fcntl(dev->fd, F_SETFD, fdflags | FD_CLOEXEC);
# endif

check_device(dev, match_types, exclude_types, settings);

Expand Down

0 comments on commit 012dd73

Please sign in to comment.