summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2024-04-15 17:12:51 +0200
committerMarius Vlad <marius.vlad0@gmail.com>2024-04-16 06:37:23 +0000
commit677025966be609524b6b10974d51eb9126b25295 (patch)
treec84dd80c1101662c003c1edd72af2db8f0eb7ee6
parent875d4b162674417e3d5b189fe849b7bbe16a4eab (diff)
tests: Call open() with the right flag
Build failed on the latest glibc (I think?), which caused this weird error: /usr/include/bits/fcntl2.h:50:11: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments In these three calls, open() was being called with 'r' flag, whose hex value is 0x72, and happens to set the O_CREAT flag (0x40) which was causing this error. The correct flag to pass is O_RDONLY. This issue exists since the creation of that file, I’m surprised it was working previously. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
-rw-r--r--tests/color-management-test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/color-management-test.c b/tests/color-management-test.c
index 630462e4..5db56153 100644
--- a/tests/color-management-test.c
+++ b/tests/color-management-test.c
@@ -595,7 +595,7 @@ create_icc_based_image_description(struct color_manager *cm,
int32_t icc_fd;
struct stat st;
- icc_fd = open(icc_path, 'r');
+ icc_fd = open(icc_path, O_RDONLY);
assert(icc_fd >= 0);
assert(fstat(icc_fd, &st) == 0);
@@ -844,7 +844,7 @@ TEST(set_bad_icc_size_zero)
image_descr_creator_icc =
xx_color_manager_v2_new_icc_creator(cm.manager);
- icc_fd = open(srgb_icc_profile_path, 'r');
+ icc_fd = open(srgb_icc_profile_path, O_RDONLY);
assert(icc_fd >= 0);
/* Try setting ICC file with a bad size, it should fail. */
@@ -903,7 +903,7 @@ TEST(set_icc_twice)
image_descr_creator_icc =
xx_color_manager_v2_new_icc_creator(cm.manager);
- icc_fd = open(srgb_icc_profile_path, 'r');
+ icc_fd = open(srgb_icc_profile_path, O_RDONLY);
assert(icc_fd >= 0);
assert(fstat(icc_fd, &st) == 0);