aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_gamma_control_v1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/types/wlr_gamma_control_v1.c b/types/wlr_gamma_control_v1.c
index b38408d3..1b771494 100644
--- a/types/wlr_gamma_control_v1.c
+++ b/types/wlr_gamma_control_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -119,7 +120,7 @@ static void gamma_control_handle_set_gamma(struct wl_client *client,
goto error_fd;
}
- ssize_t n_read = read(fd, table, table_size);
+ ssize_t n_read = pread(fd, table, table_size, 0);
if (n_read < 0) {
wlr_log_errno(WLR_ERROR, "failed to read gamma table");
gamma_control_send_failed(gamma_control);