From 6bca5af8494ba0bc8b27445aa5aa3cb1711171e0 Mon Sep 17 00:00:00 2001 From: Patrik Rak Date: Wed, 15 Apr 2020 10:09:17 +0200 Subject: [PATCH] Make the FIONBIO ioctl actually work. (#441) The fcntl needs the original `sockfd`, not the remapped one. --- libctru/source/services/soc/soc_ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libctru/source/services/soc/soc_ioctl.c b/libctru/source/services/soc/soc_ioctl.c index 227f28b..e1c131e 100644 --- a/libctru/source/services/soc/soc_ioctl.c +++ b/libctru/source/services/soc/soc_ioctl.c @@ -11,9 +11,9 @@ int ioctl(int sockfd, int request, ...) int *value; va_list ap; - sockfd = soc_get_fd(sockfd); - if(sockfd < 0) { - errno = -sockfd; + ret = soc_get_fd(sockfd); + if(ret < 0) { + errno = -ret; return -1; }