From 3e1833722fd7514213cd77c3431569fc1279d3fa Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 27 Feb 2023 18:00:41 +0100 Subject: [PATCH] engine: psvita: check req in ioctlsocket() --- engine/platform/psvita/net_psvita.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/platform/psvita/net_psvita.h b/engine/platform/psvita/net_psvita.h index 23014c72..a2451fa3 100644 --- a/engine/platform/psvita/net_psvita.h +++ b/engine/platform/psvita/net_psvita.h @@ -1,5 +1,5 @@ /* -net.h - psvita network stubs +net_psvita.h - psvita network stubs Copyright (C) 2021-2023 fgsfds This program is free software: you can redistribute it and/or modify @@ -44,7 +44,11 @@ GNU General Public License for more details. // this is only used to set non-blocking on sockets static inline int ioctlsocket( int fd, int req, unsigned int *arg ) { - return setsockopt( fd, SOL_SOCKET, SO_NONBLOCK, arg, sizeof( *arg ) ); + if ( req == FIONBIO ) + { + return setsockopt( fd, SOL_SOCKET, SO_NONBLOCK, arg, sizeof( *arg ) ); + } + return -ENOSYS; } #endif // NET_PSVITA_H