summaryrefslogtreecommitdiff
path: root/functions.cpp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-12-23 21:42:49 +0100
committertomsmeding <tom.smeding@gmail.com>2016-12-23 21:42:49 +0100
commit0ad45225f7ecb1a8a5ee6751e8f682d5966c2fd8 (patch)
tree6ebb7593bae0ee2b5fb604475549cf30295da178 /functions.cpp
parent2a952e107509cbc743b351e32663bfc8c6df9211 (diff)
Some changes that were lying aroundHEADmaster
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);
}},