aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/hello_ll.c2
-rw-r--r--example/notify_inval_inode.c6
-rw-r--r--example/notify_store_retrieve.c6
-rw-r--r--example/poll.c2
4 files changed, 4 insertions, 12 deletions
diff --git a/example/hello_ll.c b/example/hello_ll.c
index 97f3c50..51b452c 100644
--- a/example/hello_ll.c
+++ b/example/hello_ll.c
@@ -138,7 +138,7 @@ static void hello_ll_open(fuse_req_t req, fuse_ino_t ino,
{
if (ino != 2)
fuse_reply_err(req, EISDIR);
- else if ((fi->flags & 3) != O_RDONLY)
+ else if ((fi->flags & O_ACCMODE) != O_RDONLY)
fuse_reply_err(req, EACCES);
else
fuse_reply_open(req, fi);
diff --git a/example/notify_inval_inode.c b/example/notify_inval_inode.c
index 0cee6e6..cdea82d 100644
--- a/example/notify_inval_inode.c
+++ b/example/notify_inval_inode.c
@@ -76,10 +76,6 @@
timeout, so we just send a big value */
#define NO_TIMEOUT 500000
-/* We cannot check directly if e.g. O_RDONLY is set, since this is not
- * an individual bit (cf. open(2)) */
-#define ACCESS_MASK (O_RDONLY | O_WRONLY | O_RDWR)
-
#define MAX_STR_LEN 128
#define FILE_INO 2
#define FILE_NAME "current_time"
@@ -224,7 +220,7 @@ static void tfs_open(fuse_req_t req, fuse_ino_t ino,
if (ino == FUSE_ROOT_ID)
fuse_reply_err(req, EISDIR);
- else if ((fi->flags & ACCESS_MASK) != O_RDONLY)
+ else if ((fi->flags & O_ACCMODE) != O_RDONLY)
fuse_reply_err(req, EACCES);
else if (ino == FILE_INO)
fuse_reply_open(req, fi);
diff --git a/example/notify_store_retrieve.c b/example/notify_store_retrieve.c
index 8fd81ff..56cb8b7 100644
--- a/example/notify_store_retrieve.c
+++ b/example/notify_store_retrieve.c
@@ -75,10 +75,6 @@
timeout, so we just send a big value */
#define NO_TIMEOUT 500000
-/* We cannot check directly if e.g. O_RDONLY is set, since this is not
- * an individual bit (cf. open(2)) */
-#define ACCESS_MASK (O_RDONLY | O_WRONLY | O_RDWR)
-
#define MAX_STR_LEN 128
#define FILE_INO 2
#define FILE_NAME "current_time"
@@ -227,7 +223,7 @@ static void tfs_open(fuse_req_t req, fuse_ino_t ino,
if (ino == FUSE_ROOT_ID)
fuse_reply_err(req, EISDIR);
- else if ((fi->flags & ACCESS_MASK) != O_RDONLY)
+ else if ((fi->flags & O_ACCMODE) != O_RDONLY)
fuse_reply_err(req, EACCES);
else if (ino == FILE_INO)
fuse_reply_open(req, fi);
diff --git a/example/poll.c b/example/poll.c
index 8abca07..64917cc 100644
--- a/example/poll.c
+++ b/example/poll.c
@@ -115,7 +115,7 @@ static int fsel_open(const char *path, struct fuse_file_info *fi)
if (idx < 0)
return -ENOENT;
- if ((fi->flags & 3) != O_RDONLY)
+ if ((fi->flags & O_ACCMODE) != O_RDONLY)
return -EACCES;
if (fsel_open_mask & (1 << idx))
return -EBUSY;