summaryrefslogtreecommitdiff
path: root/functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'functions.cpp')
-rw-r--r--functions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/functions.cpp b/functions.cpp
index 91f6ba9..1d5d48e 100644
--- a/functions.cpp
+++ b/functions.cpp
@@ -253,8 +253,8 @@ unordered_map<string,function<void(vector<Stackitem>&,unordered_map<string,Stack
if(oflag==0)oflag=O_RDONLY;
int ret=open(fname.strval.c_str(),oflag);
if(ret<0)perror("open");
- fdtable[ret].read=(oflag&(O_RDONLY|O_RDWR))!=0;
- fdtable[ret].write=(oflag&(O_WRONLY|O_RDWR))!=0;
+ fdtable[ret].read=(oflag&O_RDONLY)==O_RDONLY||(oflag&O_RDWR)==O_RDWR;
+ fdtable[ret].write=(oflag&O_WRONLY)==O_WRONLY||(oflag&O_RDWR)==O_RDWR;
fdtable[ret].open=true;
S.emplace_back(ret);
}},