ref: df03eca7e7cbfadf1cf8c8c5a94390eaa5013a8b
dir: /emu/port/file.c/
#include "dat.h" #include "fns.h" #include "error.h" int openmode(ulong o) { if(o >= (OTRUNC|OCEXEC|ORCLOSE|OEXEC)) error(Ebadarg); o &= ~(OTRUNC|OCEXEC|ORCLOSE); if(o > OEXEC) error(Ebadarg); if(o == OEXEC) return OREAD; return o; }