fcntl: fix file flags

This commit is contained in:
Matheus
2023-09-17 01:32:20 -03:00
parent 14aca89361
commit 257ac5413c
+2 -1
View File
@@ -30,7 +30,8 @@ syscallret_t syscall_fcntl(context_t *, int fd, int cmd, uint64_t arg) {
}
break;
case F_GETFL:
ret.ret = file->flags;
// decrement to convert internal read/write flags to O_RDONLY etc
ret.ret = file->flags - 1;
break;
case F_SETFL:
FILE_LOCK(file);