Changeset 9a8c188 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2013-07-24T21:12:25Z (11 years ago)
Author:
Ji?? Z?rev?cky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1393bbb
Parents:
0b18364
Message:

Fix a bug and work around applications that call open() incorrectly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    r0b18364 r9a8c188  
    767767        }
    768768       
     769        if ((((oflag & O_RDONLY) != 0) + ((oflag & O_WRONLY) != 0) + ((oflag & O_RDWR) != 0)) != 1) {
     770                async_answer_0(rid, EINVAL);
     771                return;
     772        }
     773       
    769774        if (oflag & O_CREAT)
    770775                lflag |= L_CREATE;
     
    840845        vfs_file_t *file = vfs_file_get(fd);
    841846       
    842         /* There is a potential race with another fibril of a malicious client. */
    843         if (!file) {
    844                 vfs_node_put(node);
    845                 async_answer_0(rid, EBUSY);
    846                 return;
    847         }
     847        /* FIXME: There is a potential race with another fibril of a malicious client. */
     848        assert(file);
    848849       
    849850        file->node = node;
     
    856857        if (oflag & O_APPEND)
    857858                file->append = true;
     859        assert(file->open_read || file->open_write);
    858860       
    859861        /*
Note: See TracChangeset for help on using the changeset viewer.