* vfs.c (mc_open): Corrected FIXME. Now the "mode" parameter is

only accessed when flags contains O_CREAT.
This commit is contained in:
Roland Illig 2004-09-24 16:03:24 +00:00
parent d13910537a
commit e9fcc04816
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2004-09-24 Roland Illig <roland.illig@gmx.de>
* vfs.c (mc_open): Corrected FIXME. Now the "mode" parameter is
only accessed when flags contains O_CREAT.
2004-09-24 Roland Illig <roland.illig@gmx.de>
* cpio.c: Replaced NULL with (char *) NULL. Likewise for 0, where

View File

@ -318,10 +318,13 @@ mc_open (const char *filename, int flags, ...)
char *file = vfs_canon (filename);
struct vfs_class *vfs = vfs_get_class (file);
/* Get the mode flag */ /* FIXME: should look if O_CREAT is present */
va_start (ap, flags);
mode = va_arg (ap, int);
va_end (ap);
/* Get the mode flag */
if (flags & O_CREAT) {
va_start (ap, flags);
mode = va_arg (ap, int);
va_end (ap);
} else
mode = 0;
if (!vfs->open) {
g_free (file);