diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2022-11-17 12:36:20 +0100 | 
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2022-11-17 12:39:23 +0100 | 
| commit | 343c23ce9c7aab291721d671fe5504e7bdbfd3c2 (patch) | |
| tree | a8e23cb9bb2640ad71d69a210408962350abebf5 /src | |
| parent | 5eece7e783e177e6fcf7ed4a7185d180f9fc5565 (diff) | |
Don't check for O_PATH being defined
O_PATH has been in Linux since version 2.6.39, which was a very long
time ago.  Additionally, this library only works on Linux anyways since
the interface to backlight information is Linux-specific.  Therefore we
have no real reason to bother with handling the case where it's not
defined.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Tupfile | 1 | ||||
| -rw-r--r-- | src/lux.h | 6 | ||||
| -rw-r--r-- | src/luxinit.c | 2 | 
3 files changed, 2 insertions, 7 deletions
| diff --git a/src/Tupfile b/src/Tupfile index b6f6d4a..8cc54a0 100644 --- a/src/Tupfile +++ b/src/Tupfile @@ -3,6 +3,7 @@ CFLAGS += -Wall -Wextra -Wpedantic -Werror  CFLAGS += -march=native -mtune=native  CFLAGS += -fomit-frame-pointer -flto -O3  CFLAGS += -pipe +CFLAGS += -D_GNU_SOURCE  import CC=cc  import AR=ar @@ -21,12 +21,6 @@  #include <stdio.h>  #define LIBLUX_BACKLIGHT_DIR "/sys/class/backlight" -#ifdef O_PATH -	#define LUX_GDIR_FLAGS O_PATH -#else -	#define LUX_GDIR_FLAGS (O_RDONLY | O_DIRECTORY) -#endif -  #ifdef __cplusplus  extern "C" { diff --git a/src/luxinit.c b/src/luxinit.c index 55151b4..b5b2b84 100644 --- a/src/luxinit.c +++ b/src/luxinit.c @@ -64,7 +64,7 @@ getdir(void)  	if ((dp = readdir(dir)) == NULL  			|| (dp = readdir(dir)) == NULL  			|| (dp = readdir(dir)) == NULL -			|| (fd = openat(dfd, dp->d_name, LUX_GDIR_FLAGS)) == -1) +			|| (fd = openat(dfd, dp->d_name, O_PATH)) == -1)  		fd = -1;  	close(dfd); |