From 1eebce1c2b21d1dbf91824be48dac56e944a78da Mon Sep 17 00:00:00 2001 From: Patrik Rak Date: Wed, 11 Dec 2019 09:17:13 +0100 Subject: [PATCH] Make the FIONBIO ioctl actually work. 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; }