From 7502ecfc0c7dbbd652c92e6a92305c0f0ce2fbf8 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 7 Jul 2015 07:20:21 +0200 Subject: fix error where mode_t argument was not added when O_CREAT was used in open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-vt.c | 2 +- src/mds.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds-vt.c b/src/mds-vt.c index 5072d85..7587f41 100644 --- a/src/mds-vt.c +++ b/src/mds-vt.c @@ -160,7 +160,7 @@ static int write_vt_file(void) *intbuf = display_vt; *(struct stat*)(buf + sizeof(int) / sizeof(char)) = old_vt_stat; - fail_if (open(vtfile_path, O_WRONLY | O_CREAT), fd < 0); + fail_if (open(vtfile_path, O_WRONLY | O_CREAT, 0644), fd < 0); fail_if (full_write(fd, buf, sizeof(buf))); return 0; fail: diff --git a/src/mds.c b/src/mds.c index b6f6abb..cb39005 100644 --- a/src/mds.c +++ b/src/mds.c @@ -128,7 +128,7 @@ int main(int argc_, char** argv_) { xsnprintf(pathname, "%s/%u.pid", MDS_RUNTIME_ROOT_DIRECTORY, display); - fd = open(pathname, O_CREAT | O_EXCL); + fd = open(pathname, O_CREAT | O_EXCL, 0644); if (fd == -1) { /* Reuse display index if no longer used. */ -- cgit v1.2.3-70-g09d2