From 5bcf80fb5519aba5912d2e99e1f749d845b82329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Fri, 21 Feb 2025 16:00:40 +0000 Subject: [PATCH] CA-406953: fix(open): must supply mode with O_CREAT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: ``` /usr/include/x86_64-linux-gnu/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 ``` Signed-off-by: Edwin Török --- lib/weightio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/weightio.c b/lib/weightio.c index 273642c..d951beb 100644 --- a/lib/weightio.c +++ b/lib/weightio.c @@ -121,7 +121,7 @@ MTC_STATUS open_hostweight_file(int *fd, int *err_no) { - if ((*fd = open(HA_HOST_WEIGHT_FILE, O_RDWR|O_CREAT)) < 0) + if ((*fd = open(HA_HOST_WEIGHT_FILE, O_RDWR|O_CREAT, 00400)) < 0) { *err_no = errno; return MTC_ERROR_WEIGHT_OPEN;