]> pd.if.org Git - pdclib/blobdiff - platform/example/functions/_PDCLIB/open.c
New file permissions.
[pdclib] / platform / example / functions / _PDCLIB / open.c
index f0379ba64d986823fa6dc6acf37ccd3daf67570a..133b729d16cd9562dabc0669aed3c4c08118e707 100644 (file)
@@ -26,8 +26,6 @@ int _PDCLIB_open( char const * const filename, unsigned int mode )
 {
     /* This is an example implementation of _PDCLIB_open() fit for use with
        POSIX kernels.
-       FIXME: The permissions of newly created files should not be hardcoded
-       here.
     */
     int osmode;
     switch ( mode & ( _PDCLIB_FREAD | _PDCLIB_FWRITE | _PDCLIB_FAPPEND | _PDCLIB_FRW ) )
@@ -56,7 +54,7 @@ int _PDCLIB_open( char const * const filename, unsigned int mode )
     int rc;
     if ( osmode & O_CREAT )
     {
-        rc = open( filename, osmode, S_IRUSR | S_IWUSR );
+        rc = open( filename, osmode, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH );
     }
     else
     {