Changeset 9a8c188 in mainline for uspace/lib/c/generic/vfs/vfs.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/lib/c/generic/vfs/vfs.c

    r0b18364 r9a8c188  
    329329static int open_internal(const char *abs, size_t abs_size, int lflag, int oflag)
    330330{
     331        // FIXME: Some applications call this incorrectly.
     332        if ((oflag & (O_RDONLY|O_WRONLY|O_RDWR)) == 0) {
     333                oflag |= O_RDWR;
     334        }
     335
     336        assert((((oflag & O_RDONLY) != 0) + ((oflag & O_WRONLY) != 0) + ((oflag & O_RDWR) != 0)) == 1);
     337       
    331338        async_exch_t *exch = vfs_exchange_begin();
    332339       
Note: See TracChangeset for help on using the changeset viewer.