From 8acea8220797db60c93a451e335803a8f9fcba3c Mon Sep 17 00:00:00 2001 From: nvt-se Date: Mon, 10 Aug 2009 09:50:55 +0000 Subject: [PATCH] Set a file mode in the third argument when calling open() with O_CREAT in the flags. Required by IEEE Std 1003.1, 2004 Edition. --- core/cfs/cfs-posix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/cfs/cfs-posix.c b/core/cfs/cfs-posix.c index 712f1bfed..23b41789d 100644 --- a/core/cfs/cfs-posix.c +++ b/core/cfs/cfs-posix.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: cfs-posix.c,v 1.14 2009/02/27 14:50:35 nvt-se Exp $ + * $Id: cfs-posix.c,v 1.15 2009/08/10 09:50:55 nvt-se Exp $ */ #include @@ -49,7 +49,7 @@ cfs_open(const char *n, int f) { int s = 0; if(f == CFS_READ) { - s = O_RDONLY; + return open(n, O_RDONLY); } else if(f & CFS_WRITE) { s = O_CREAT; if(f & CFS_READ) { @@ -62,8 +62,9 @@ cfs_open(const char *n, int f) } else { s |= O_TRUNC; } + return open(n, s, 0600); } - return open(n, s); + return -1; } /*---------------------------------------------------------------------------*/ void