summaryrefslogtreecommitdiff
path: root/missing/nt.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing/nt.c')
-rw-r--r--missing/nt.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/missing/nt.c b/missing/nt.c
index 1cd81fd28c..703556cad7 100644
--- a/missing/nt.c
+++ b/missing/nt.c
@@ -149,8 +149,8 @@ flock(int fd, int oper)
#undef LK_LEN
-#undef const
-FILE *fdopen(int, const char *);
+//#undef const
+//FILE *fdopen(int, const char *);
#if 0
void
@@ -185,7 +185,7 @@ NtInitialize(int *argc, char ***argv) {
tzset();
// Initialize Winsock
- // StartSockets();
+ StartSockets();
}
@@ -501,7 +501,6 @@ mypopen (char *cmd, char *mode)
return fp;
}
-
fRet = CreatePipe(&hInFile, &hOutFile, &sa, 2048L);
if (!fRet)
Fatal("cannot open pipe \"%s\" (%s)", cmd, strerror(errno));
@@ -1572,7 +1571,7 @@ valid_filename(char *s)
//
FILE *
-fdopen (int fd, const char *mode)
+myfdopen (int fd, const char *mode)
{
FILE *fp;
char sockbuf[80];
@@ -1580,6 +1579,8 @@ fdopen (int fd, const char *mode)
int retval;
extern int errno;
+ //fprintf(stderr, "myfdopen()\n");
+
retval = getsockopt((SOCKET)fd, SOL_SOCKET, SO_TYPE, sockbuf, &optlen);
if (retval == SOCKET_ERROR) {
int iRet;
@@ -1951,8 +1952,10 @@ mysocket (int af, int type, int protocol)
if (!NtSocketsInitialized++) {
StartSockets();
}
- if ((s = socket (af, type, protocol)) == INVALID_SOCKET)
+ if ((s = socket (af, type, protocol)) == INVALID_SOCKET) {
errno = WSAGetLastError();
+ //fprintf(stderr, "socket fail (%d)", WSAGetLastError());
+ }
return s;
}