From a0a9379214eea767b6bf4ae9bad10a2b71bde950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Tue, 10 Feb 1998 16:54:35 -0800 Subject: [PATCH] changed from winsock2 to winsock Rev: src/modules/files/configure.in:1.40 Rev: src/modules/files/file.c:1.75 Rev: src/modules/files/socket.c:1.29 --- src/modules/files/configure.in | 2 +- src/modules/files/file.c | 13 +++++++++---- src/modules/files/socket.c | 5 +++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/modules/files/configure.in b/src/modules/files/configure.in index 59a01916dd..fc773c474b 100644 --- a/src/modules/files/configure.in +++ b/src/modules/files/configure.in @@ -5,7 +5,7 @@ sinclude(../module_configure.in) AC_HAVE_HEADERS(sys/types.h arpa/inet.h sys/socketvar.h netinet/in.h \ sys/mount.h ustat.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \ - sys/socket.h sys/stream.h sys/protosw.h netdb.h sys/sysproto.h winsock2.h \ + sys/socket.h sys/stream.h sys/protosw.h netdb.h sys/sysproto.h winsock.h \ direct.h sys/wait.h) AC_HEADER_DIRENT AC_CHECK_LIB(bind, __inet_ntoa) diff --git a/src/modules/files/file.c b/src/modules/files/file.c index 21a2bdf937..4717cac856 100644 --- a/src/modules/files/file.c +++ b/src/modules/files/file.c @@ -6,7 +6,7 @@ #define READ_BUFFER 8192 #include "global.h" -RCSID("$Id: file.c,v 1.74 1998/02/05 03:02:49 hubbe Exp $"); +RCSID("$Id: file.c,v 1.75 1998/02/11 00:54:35 hubbe Exp $"); #include "fdlib.h" #include "interpret.h" #include "svalue.h" @@ -43,8 +43,8 @@ RCSID("$Id: file.c,v 1.74 1998/02/05 03:02:49 hubbe Exp $"); # include <sys/socket.h> #endif -#ifdef HAVE_WINSOCK2_H -# include <winsock2.h> +#ifdef HAVE_WINSOCK_H +# include <winsock.h> #ifndef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK #endif @@ -825,6 +825,12 @@ static void file_set_nonblocking(INT32 args) if(!(files[FD].open_mode & fd_CAN_NONBLOCK)) error("That file does not support nonblocking operation.\n"); + if(set_nonblocking(FD,1)) + { + ERRNO=errno; + error("Stdio.File->set_nonbloblocking() failed.\n"); + } + switch(args) { default: pop_n_elems(args-3); @@ -833,7 +839,6 @@ static void file_set_nonblocking(INT32 args) case 1: file_set_read_callback(1); case 0: break; } - set_nonblocking(FD,1); THIS->open_mode |= FILE_NONBLOCKING; } diff --git a/src/modules/files/socket.c b/src/modules/files/socket.c index 76e052bf24..fa157f8daf 100644 --- a/src/modules/files/socket.c +++ b/src/modules/files/socket.c @@ -35,8 +35,8 @@ #include <sys/socket.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> +#ifdef HAVE_WINSOCK_H +#include <winsock.h> #endif #ifdef HAVE_SYS_STREAM_H @@ -119,6 +119,7 @@ static void port_accept_callback(int fd,void *data) fatal("Port is in blocking mode in port accept callback!!!\n"); #endif #endif + assign_svalue_no_free(sp++, &f->id); apply_svalue(& f->accept_callback, 1); pop_stack(); -- GitLab