Skip to content

gh-124621: Emscripten: Fix __syscall_ioctl patch #136993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-124621: Emscripten: Fix __syscall_ioctl patch
If there is an error, we have to return `-errno` not positive errno.
Included in backport of GH-136931: #136988
  • Loading branch information
hoodmane committed Jul 22, 2025
commit 9dad34c7673a3bb0db7c97c42148c53e3121a24b
4 changes: 2 additions & 2 deletions Python/emscripten_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ int __syscall_ioctl(int fd, int request, void* varargs) {
int flags = fcntl(fd, F_GETFL, 0);
int nonblock = **((int**)varargs);
if (flags < 0) {
return errno;
return -errno;
}
if (nonblock) {
flags |= O_NONBLOCK;
Expand All @@ -311,7 +311,7 @@ int __syscall_ioctl(int fd, int request, void* varargs) {
}
int res = fcntl(fd, F_SETFL, flags);
if (res < 0) {
return errno;
return -errno;
}
return res;
}
Expand Down
Loading