summaryrefslogtreecommitdiff
path: root/src/sys_unix.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2012-02-04 22:17:01 +0400
committerAndrey Nazarov <skuller@skuller.net>2012-04-03 01:25:48 +0400
commit2d10d077d5d7a0e9bdb76bc3e7b343b70da11ad7 (patch)
tree5e4c8236c1d305502d7317236d55ff3aa475b553 /src/sys_unix.c
parent11e971ca37d6612741c95a1b950cfa51e90a36a5 (diff)
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.
Diffstat (limited to 'src/sys_unix.c')
-rw-r--r--src/sys_unix.c6
1 files changed, 3 insertions, 3 deletions
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