From 2d10d077d5d7a0e9bdb76bc3e7b343b70da11ad7 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sat, 4 Feb 2012 22:17:01 +0400 Subject: Clean up and fix sockets code. Get rid of ugly #ifdefs and macros. Add thin wrapper layer around socket functions to hide OS-specific details like error handling, etc. Merge IO sleep code into net_common.c. Report WSA errors in human readable way. Don't mess with net_from when handling ICMP errors on Linux. It was possible to send packet to wrong address if sento() call results in ICMP error. Fix NET_Sleepv() referencing wrong IO entry on Win32. --- src/sys_unix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sys_unix.c') diff --git a/src/sys_unix.c b/src/sys_unix.c index d1d7dee..c8e371c 100644 --- a/src/sys_unix.c +++ b/src/sys_unix.c @@ -52,7 +52,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "vid_public.h" #endif #include "sys_public.h" -#include "io_sleep.h" +#include "net_sock.h" cvar_t *sys_basedir; cvar_t *sys_libdir; @@ -205,7 +205,7 @@ static void tty_init_input(void) static void tty_shutdown_input(void) { if (tty_io) { - IO_Remove(STDIN_FILENO); + NET_RemoveFd(STDIN_FILENO); tty_io = NULL; } if (tty_enabled) { @@ -771,7 +771,7 @@ void Sys_Init(void) fcntl(STDOUT_FILENO, F_SETFL, ret | O_NONBLOCK); // add stdin to the list of descriptors to wait on - tty_io = IO_Add(STDIN_FILENO); + tty_io = NET_AddFd(STDIN_FILENO); tty_io->wantread = qtrue; // init optional TTY support -- cgit v1.2.3