[vhffs-dev] [1625] O_RDONLY value is 0, so O_RDONLY is the default, then we need to test O_WRONLY and O_RDWR instead of O_RDONLY and O_WRONLY, and set O_RDONLY as default action |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [1625] O_RDONLY value is 0, so O_RDONLY is the default, then we need to test O_WRONLY and O_RDWR instead of O_RDONLY and O_WRONLY, and set O_RDONLY as default action
- From: subversion@xxxxxxxxxxxxx
- Date: Tue, 07 Sep 2010 01:37:14 +0200
Revision: 1625
Author: gradator
Date: 2010-09-07 01:37:13 +0200 (Tue, 07 Sep 2010)
Log Message:
-----------
O_RDONLY value is 0, so O_RDONLY is the default, then we need to test O_WRONLY and O_RDWR instead of O_RDONLY and O_WRONLY, and set O_RDONLY as default action
Modified Paths:
--------------
trunk/vhffs-fs/vhffsfs.c
Modified: trunk/vhffs-fs/vhffsfs.c
===================================================================
--- trunk/vhffs-fs/vhffsfs.c 2010-09-06 23:16:04 UTC (rev 1624)
+++ trunk/vhffs-fs/vhffsfs.c 2010-09-06 23:37:13 UTC (rev 1625)
@@ -1799,12 +1799,14 @@
{
int fd;
char *rpath;
- int mode = R_OK|W_OK;
+ int mode = R_OK;
- if(fi->flags & O_WRONLY)
+ if(fi->flags & O_WRONLY) {
mode = W_OK;
- else if(fi->flags & O_RDONLY)
- mode = R_OK;
+ }
+ else if(fi->flags & O_RDWR) {
+ mode = R_OK|W_OK;
+ }
rpath = vhffsfs_realpath(path, NULL, NULL, mode);
if(!rpath) return -errno;