syscalls: implement O_CLOEXEC properly

This commit is contained in:
Matheus
2024-05-08 20:57:52 -03:00
parent c894352bc8
commit ce3fad266b
3 changed files with 14 additions and 7 deletions
+1 -2
View File
@@ -28,10 +28,9 @@ syscallret_t syscall_openat(context_t *context, int dirfd, const char *path, int
ret.errno = dirfd_enter(pathbuf, dirfd, &dirfile, &dirnode);
// TODO pass CLOEXEC to fd
file_t *newfile = NULL;
int newfd;
ret.errno = fd_new(0, &newfile, &newfd);
ret.errno = fd_new(flags & O_CLOEXEC, &newfile, &newfd);
if (ret.errno)
goto cleanup;