From 66944032145c376ac8296435d7ad00547608b72c Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Mon, 22 Sep 2014 19:50:00 +0400 Subject: [PATCH] zdtm/tempfs: set mode for O_CREAT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit man 2 open: """ mode specifies the permissions to use in case a new file is cre‐ ated. This argument must be supplied when O_CREAT or O_TMPFILE is specified in flags; """ Cc: Konstantin Neumoin Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- test/zdtm/live/static/tempfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/zdtm/live/static/tempfs.c b/test/zdtm/live/static/tempfs.c index 3a6f449db..b6b0bac3b 100644 --- a/test/zdtm/live/static/tempfs.c +++ b/test/zdtm/live/static/tempfs.c @@ -31,7 +31,7 @@ int main(int argc, char **argv) } snprintf(fname, sizeof(buf), "%s/test.file", dirname); - fdo = open(fname, O_RDWR | O_CREAT); + fdo = open(fname, O_RDWR | O_CREAT, 0644); if (fdo < 0) { err("open failed"); goto err; @@ -46,7 +46,7 @@ int main(int argc, char **argv) mkdir(overmount, 0700); snprintf(fname, sizeof(buf), "%s/test.file", overmount); - fd = open(fname, O_RDWR | O_CREAT); + fd = open(fname, O_RDWR | O_CREAT, 0644); if (fd < 0) { err("open failed"); goto err;