mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Various patches/fixes (mingw)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21898 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7ab19b7cd9
commit
fee1d187a3
7 changed files with 111 additions and 98 deletions
|
@ -1,3 +1,12 @@
|
|||
2005-10-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/gdomap.c: standardise on __MINGW32__
|
||||
* Source/win32/NSUserDefaultsWin32.m: patch #4567 fix a few typos
|
||||
* Source/DocMakefile: get right path for autogsdoc on mingw
|
||||
* Tools/DocMakefile: ditto (patch #4568)
|
||||
* Tools/AGSHtml.m: work round isssues with windows help (patch #4569)
|
||||
Mostly fixes by Jeremy Bettis
|
||||
|
||||
2005-10-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/AGSParser.m: Fix error setting version numbers for the
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#define __MINGW__
|
||||
#endif
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
|
|
|
@ -167,7 +167,7 @@ BaseAdditions_AGSDOC_FLAGS = \
|
|||
}' -Up BaseAdditions
|
||||
|
||||
# Use local version of autogsdoc in case it is not installed
|
||||
AUTOGSDOC=../Tools/obj/autogsdoc
|
||||
AUTOGSDOC=../Tools/$(GNUSTEP_OBJ_PREFIX)/autogsdoc
|
||||
|
||||
# Fool make into thinking we are installed even if we are not
|
||||
BASE_MAKE_LOADED=yes
|
||||
|
|
|
@ -94,8 +94,11 @@ struct NSUserDefaultsWin32_DomainInfo
|
|||
@"NSUserDefaultsWin32 should only be used if defaults directory is :REGISTRY:");
|
||||
|
||||
path = [path substringFromIndex: NSMaxRange(r)];
|
||||
path = [@"Software\\GNUstep\\" stringByAppendingString: path];
|
||||
if ([path hasSuffix: @"\\"] == NO)
|
||||
if ([path length] == 0)
|
||||
{
|
||||
path = @"Software\\GNUstep\\";
|
||||
}
|
||||
else if ([path hasSuffix: @"\\"] == NO)
|
||||
{
|
||||
path = [path stringByAppendingString: @"\\"];
|
||||
}
|
||||
|
@ -474,7 +477,11 @@ struct NSUserDefaultsWin32_DomainInfo
|
|||
oldDomainDict = [oldData objectForKey: persistantDomain];
|
||||
dPath = [registryPrefix stringByAppendingString: persistantDomain];
|
||||
|
||||
if ([domainDict count] && !dinfo->userKey)
|
||||
if ([domainDict count] == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (dinfo->userKey == 0)
|
||||
{
|
||||
rc = RegCreateKeyEx(HKEY_CURRENT_USER,
|
||||
[dPath cString],
|
||||
|
@ -493,10 +500,6 @@ struct NSUserDefaultsWin32_DomainInfo
|
|||
return NO;
|
||||
}
|
||||
}
|
||||
else if ([domainDict count] > 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
valIter = [domainDict keyEnumerator];
|
||||
while ((valName = [valIter nextObject]))
|
||||
|
@ -504,7 +507,7 @@ struct NSUserDefaultsWin32_DomainInfo
|
|||
id value = [domainDict objectForKey: valName];
|
||||
id oldvalue = [oldDomainDict objectForKey: valName];
|
||||
|
||||
if (oldvalue != nil || [value isEqual: oldvalue] == NO)
|
||||
if (oldvalue == nil || [value isEqual: oldvalue] == NO)
|
||||
{
|
||||
NSString *result = 0;
|
||||
|
||||
|
|
|
@ -175,6 +175,7 @@ static NSString *mainFont = nil;
|
|||
NSString *s;
|
||||
NSString *kind = (f == YES) ? @"rel=\"gsdoc\" href" : @"name";
|
||||
NSString *hash = (f == YES) ? @"#" : @"";
|
||||
r = [r stringByReplacingString:@":" withString:@"$"];
|
||||
|
||||
if (f == NO || (s = [localRefs globalRef: r type: t]) != nil)
|
||||
{
|
||||
|
@ -206,6 +207,7 @@ static NSString *mainFont = nil;
|
|||
NSString *s = nil;
|
||||
NSString *kind = (f == YES) ? @"rel=\"gsdoc\" href" : @"name";
|
||||
NSString *hash = (f == YES) ? @"#" : @"";
|
||||
r = [r stringByReplacingString:@":" withString:@"$"];
|
||||
|
||||
if (f == NO)
|
||||
{
|
||||
|
@ -347,6 +349,7 @@ static NSString *mainFont = nil;
|
|||
NSString *ref = [a objectAtIndex: i];
|
||||
NSString *text = [dict objectForKey: ref];
|
||||
NSString *file = ref;
|
||||
ref = [ref stringByReplacingString:@":" withString:@"$"];
|
||||
|
||||
if ([file isEqual: base] == YES)
|
||||
{
|
||||
|
@ -480,6 +483,7 @@ static NSString *mainFont = nil;
|
|||
NSString *ref = [a objectAtIndex: i];
|
||||
NSString *file = [dict objectForKey: ref];
|
||||
NSString *text = ref;
|
||||
ref = [ref stringByReplacingString:@":" withString:@"$"];
|
||||
|
||||
/*
|
||||
* If a reference to a method contains a leading category name,
|
||||
|
|
|
@ -75,7 +75,7 @@ BaseTools_AGSDOC_FLAGS = \
|
|||
}' -Up BaseTools
|
||||
|
||||
# Use local version of autogsdoc in case it is not installed
|
||||
AUTOGSDOC=../Tools/obj/autogsdoc
|
||||
AUTOGSDOC=../Tools/$(GNUSTEP_OBJ_PREFIX)/autogsdoc
|
||||
BASE_MAKE_LOADED=yes
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/documentation.make
|
||||
|
|
170
Tools/gdomap.c
170
Tools/gdomap.c
|
@ -23,8 +23,8 @@
|
|||
|
||||
/* Ported to mingw 07/12/00 by Björn Giesler <Bjoern.Giesler@gmx.de> */
|
||||
#ifdef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#define __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
#define __MINGW32__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -32,20 +32,20 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h> /* for gethostname() */
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
#include <sys/param.h> /* for MAXHOSTNAMELEN */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h> /* for inet_ntoa() */
|
||||
#endif /* !__MINGW__ */
|
||||
#endif /* !__MINGW32__ */
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <string.h> /* for strchr() */
|
||||
#include <ctype.h> /* for strchr() */
|
||||
#include <fcntl.h>
|
||||
#include "config.h"
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <wininet.h>
|
||||
|
@ -93,7 +93,7 @@
|
|||
#if defined(__svr4__)
|
||||
#include <sys/stropts.h>
|
||||
#endif
|
||||
#endif /* !__MINGW__ */
|
||||
#endif /* !__MINGW32__ */
|
||||
|
||||
|
||||
#ifdef HAVE_SYSLOG_H
|
||||
|
@ -133,7 +133,7 @@
|
|||
__a*((__v+__a-1)/__a); })
|
||||
|
||||
typedef unsigned char *uptr;
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
static int is_daemon = 0; /* Currently running as daemon. */
|
||||
#endif
|
||||
static int debug = 0; /* Extra debug gdomap_logging. */
|
||||
|
@ -165,7 +165,7 @@ struct in_addr class_c_mask;
|
|||
* Predeclare some of the functions used.
|
||||
*/
|
||||
static void dump_stats();
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
static void dump_tables();
|
||||
#endif
|
||||
static void handle_accept();
|
||||
|
@ -186,7 +186,7 @@ static void queue_probe(struct in_addr* to, struct in_addr *from,
|
|||
|
||||
char *xgethostname (void);
|
||||
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
#ifndef HAVE_GETOPT
|
||||
/* A simple implementation of getopt() */
|
||||
|
||||
|
@ -382,11 +382,11 @@ static fd_set write_fds; /* Descriptors which are writable. */
|
|||
Bjoern Giesler <Bjoern.Giesler@gmx.de> to work on Win32. */
|
||||
|
||||
typedef struct {
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
SOCKET s;
|
||||
#else
|
||||
int s;
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
struct sockaddr_in addr; /* Address of process making request. */
|
||||
unsigned int pos; /* Position reading data. */
|
||||
union {
|
||||
|
@ -396,11 +396,11 @@ typedef struct {
|
|||
} RInfo; /* State of reading each request. */
|
||||
|
||||
typedef struct {
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
SOCKET s;
|
||||
#else
|
||||
int s;
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
int len; /* Length of data to be written. */
|
||||
int pos; /* Amount of data already written. */
|
||||
char* buf; /* Buffer for data. */
|
||||
|
@ -414,11 +414,11 @@ static unsigned _wInfoCapacity = 0;
|
|||
static unsigned _wInfoCount = 0;
|
||||
|
||||
static void
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
delRInfo(SOCKET s)
|
||||
#else
|
||||
delRInfo(int s)
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -445,7 +445,7 @@ delRInfo(int s)
|
|||
|
||||
|
||||
static RInfo *
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
getRInfo(SOCKET s, int make)
|
||||
#else
|
||||
getRInfo(int s, int make)
|
||||
|
@ -487,11 +487,11 @@ getRInfo(int s, int make)
|
|||
}
|
||||
|
||||
static void
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
delWInfo(SOCKET s)
|
||||
#else
|
||||
delWInfo(int s)
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -518,7 +518,7 @@ delWInfo(int s)
|
|||
|
||||
|
||||
static WInfo *
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
getWInfo(SOCKET s, int make)
|
||||
#else
|
||||
getWInfo(int s, int make)
|
||||
|
@ -968,7 +968,7 @@ prb_tim(time_t when)
|
|||
static void
|
||||
clear_chan(int desc)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (desc != INVALID_SOCKET)
|
||||
#else
|
||||
if (desc >= 0 && desc < FD_SETSIZE)
|
||||
|
@ -984,7 +984,7 @@ clear_chan(int desc)
|
|||
else
|
||||
{
|
||||
FD_CLR(desc, &read_fds);
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -1038,7 +1038,7 @@ dump_stats()
|
|||
gdomap_log(LOG_INFO);
|
||||
}
|
||||
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
static void
|
||||
dump_tables()
|
||||
{
|
||||
|
@ -1085,7 +1085,7 @@ dump_tables()
|
|||
static void
|
||||
init_iface()
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
INTERFACE_INFO InterfaceList[20];
|
||||
unsigned long nBytesReturned;
|
||||
int i, countActive, nNumInterfaces;
|
||||
|
@ -1642,9 +1642,9 @@ init_ports()
|
|||
{
|
||||
int r;
|
||||
struct sockaddr_in sa;
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
unsigned long dummy;
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
/*
|
||||
* Now we set up the sockets to accept incoming connections and set
|
||||
|
@ -1653,7 +1653,7 @@ init_ports()
|
|||
*/
|
||||
|
||||
udp_desc = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (udp_desc == INVALID_SOCKET)
|
||||
#else
|
||||
if (udp_desc < 0)
|
||||
|
@ -1692,7 +1692,7 @@ init_ports()
|
|||
gdomap_log(LOG_WARNING);
|
||||
}
|
||||
}
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
dummy = 1;
|
||||
if (ioctlsocket(udp_desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
|
@ -1700,7 +1700,7 @@ init_ports()
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#else /* !__MINGW__ */
|
||||
#else /* !__MINGW32__ */
|
||||
if ((r = fcntl(udp_desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
r |= NBLK_OPT;
|
||||
|
@ -1746,7 +1746,7 @@ init_ports()
|
|||
* Now we do the TCP socket.
|
||||
*/
|
||||
tcp_desc = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (tcp_desc == INVALID_SOCKET)
|
||||
#else
|
||||
if (tcp_desc < 0)
|
||||
|
@ -1776,7 +1776,7 @@ init_ports()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
dummy = 1;
|
||||
if (ioctlsocket(tcp_desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
|
@ -1784,7 +1784,7 @@ init_ports()
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#else /* !__MINGW__ */
|
||||
#else /* !__MINGW32__ */
|
||||
if ((r = fcntl(tcp_desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
r |= NBLK_OPT;
|
||||
|
@ -1801,7 +1801,7 @@ init_ports()
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
memset(&sa, '\0', sizeof(sa));
|
||||
sa.sin_family = AF_INET;
|
||||
|
@ -1841,7 +1841,7 @@ init_ports()
|
|||
FD_SET(tcp_desc, &read_fds);
|
||||
FD_SET(udp_desc, &read_fds);
|
||||
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
/*
|
||||
* Turn off pipe signals so we don't get interrupted if we attempt
|
||||
* to write a response to a process which has died.
|
||||
|
@ -1851,7 +1851,7 @@ init_ports()
|
|||
* Enable table dumping to /tmp/gdomap.dump
|
||||
*/
|
||||
signal(SIGUSR1, dump_tables);
|
||||
#endif /* !__MINGW__ */
|
||||
#endif /* !__MINGW32__ */
|
||||
}
|
||||
|
||||
|
||||
|
@ -2158,11 +2158,11 @@ handle_accept()
|
|||
if (desc >= 0)
|
||||
{
|
||||
RInfo *ri;
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
unsigned long dummy = 1;
|
||||
#else
|
||||
int r;
|
||||
#endif /* !__MINGW__ */
|
||||
#endif /* !__MINGW32__ */
|
||||
|
||||
FD_SET(desc, &read_fds);
|
||||
ri = getRInfo(desc, 1);
|
||||
|
@ -2178,7 +2178,7 @@ handle_accept()
|
|||
/*
|
||||
* Ensure that the connection is non-blocking.
|
||||
*/
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (ioctlsocket(desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
if (debug)
|
||||
|
@ -2188,7 +2188,7 @@ handle_accept()
|
|||
}
|
||||
clear_chan(desc);
|
||||
}
|
||||
#else /* !__MINGW__ */
|
||||
#else /* !__MINGW32__ */
|
||||
if ((r = fcntl(desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
r |= NBLK_OPT;
|
||||
|
@ -2211,16 +2211,16 @@ handle_accept()
|
|||
}
|
||||
clear_chan(desc);
|
||||
}
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
}
|
||||
else if (debug)
|
||||
{
|
||||
sprintf(ebuf, "accept failed - errno %d",
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
WSAGetLastError());
|
||||
#else
|
||||
errno);
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
|
@ -2342,7 +2342,7 @@ handle_io()
|
|||
/*
|
||||
* Got some descriptor activity - deal with it.
|
||||
*/
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
/* read file descriptors */
|
||||
for (i = 0; i < rfds.fd_count; i++)
|
||||
{
|
||||
|
@ -2374,7 +2374,7 @@ handle_io()
|
|||
handle_write(wfds.fd_array[i]);
|
||||
}
|
||||
}
|
||||
#else /* !__MINGW__ */
|
||||
#else /* !__MINGW32__ */
|
||||
for (i = 0; i < FD_SETSIZE; i++)
|
||||
{
|
||||
if (FD_ISSET(i, &rfds))
|
||||
|
@ -2408,7 +2408,7 @@ handle_io()
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2432,7 +2432,7 @@ handle_read(int desc)
|
|||
|
||||
while (ri->pos < GDO_REQ_SIZE && done == 0)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
r = recv(desc, &ptr[ri->pos],
|
||||
GDO_REQ_SIZE - ri->pos, 0);
|
||||
#else
|
||||
|
@ -2454,7 +2454,7 @@ handle_read(int desc)
|
|||
tcp_read++;
|
||||
handle_request(desc);
|
||||
}
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
else if (WSAGetLastError() != WSAEWOULDBLOCK || nothingRead == 1)
|
||||
#else
|
||||
else if (errno != EWOULDBLOCK || nothingRead == 1)
|
||||
|
@ -2510,7 +2510,7 @@ handle_recv()
|
|||
if (debug)
|
||||
{
|
||||
sprintf(ebuf, "recvfrom returned %d - "
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
"WSAGetLastError() = %d\n", r, WSAGetLastError());
|
||||
#else
|
||||
"%m", r);
|
||||
|
@ -2708,7 +2708,7 @@ handle_request(int desc)
|
|||
*(unsigned long*)wi->buf = port;
|
||||
}
|
||||
}
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
/* closesocket(sock); */
|
||||
#else
|
||||
close(sock);
|
||||
|
@ -2795,11 +2795,11 @@ handle_request(int desc)
|
|||
otherwise the system will try to bind on any of
|
||||
the local addresses (including 127.0.0.1), which
|
||||
works. - bjoern */
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
sa.sin_addr.s_addr = addr[0].s_addr;
|
||||
#else
|
||||
sa.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
sa.sin_port = htons(p);
|
||||
result = bind(sock, (void*)&sa, sizeof(sa));
|
||||
if (result == 0)
|
||||
|
@ -2808,7 +2808,7 @@ handle_request(int desc)
|
|||
m = 0;
|
||||
}
|
||||
}
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
|
@ -2953,7 +2953,7 @@ handle_request(int desc)
|
|||
sprintf(ebuf, "Probe from '%s'", inet_ntoa(sin));
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (IN_CLASSA(sin.s_addr))
|
||||
{
|
||||
net = sin.s_addr & IN_CLASSA_NET;
|
||||
|
@ -3088,7 +3088,7 @@ handle_request(int desc)
|
|||
sprintf(ebuf, "Probe reply from '%s'", inet_ntoa(sin));
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (IN_CLASSA(sin.s_addr))
|
||||
{
|
||||
net = sin.s_addr & IN_CLASSA_NET;
|
||||
|
@ -3190,7 +3190,7 @@ handle_send()
|
|||
*/
|
||||
if (entry->pos != entry->len)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EWOULDBLOCK)
|
||||
|
@ -3253,7 +3253,7 @@ handle_write(int desc)
|
|||
ptr = wi->buf;
|
||||
len = wi->len;
|
||||
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
r = send(desc, &ptr[wi->pos], len - wi->pos, 0);
|
||||
#else
|
||||
r = write(desc, &ptr[wi->pos], len - wi->pos);
|
||||
|
@ -3362,14 +3362,14 @@ tryRead(int desc, int tim, unsigned char* dat, int len)
|
|||
}
|
||||
else if (len > 0)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
rval = recv(desc, &dat[pos], len - pos, 0);
|
||||
#else
|
||||
rval = read(desc, &dat[pos], len - pos);
|
||||
#endif
|
||||
if (rval < 0)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EWOULDBLOCK)
|
||||
|
@ -3468,7 +3468,7 @@ tryWrite(int desc, int tim, unsigned char* dat, int len)
|
|||
}
|
||||
else if (len > 0)
|
||||
{
|
||||
#ifdef __MINGW__ /* FIXME: Is this correct? */
|
||||
#ifdef __MINGW32__ /* FIXME: Is this correct? */
|
||||
rval = send(desc, &dat[pos], len - pos, 0);
|
||||
#else
|
||||
void (*ifun)();
|
||||
|
@ -3484,7 +3484,7 @@ tryWrite(int desc, int tim, unsigned char* dat, int len)
|
|||
|
||||
if (rval <= 0)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EWOULDBLOCK)
|
||||
|
@ -3524,9 +3524,9 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
unsigned long port = *p;
|
||||
gdo_req msg;
|
||||
struct sockaddr_in sin;
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
unsigned long dummy;
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
*p = 0;
|
||||
if (desc < 0)
|
||||
|
@ -3534,7 +3534,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
return 1; /* Couldn't create socket. */
|
||||
}
|
||||
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
dummy = 1;
|
||||
if (ioctlsocket(desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
|
@ -3543,7 +3543,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
WSASetLastError(e);
|
||||
return 2; /* Couldn't set non-blocking. */
|
||||
}
|
||||
#else /* !__MINGW__ */
|
||||
#else /* !__MINGW32__ */
|
||||
if ((e = fcntl(desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
e |= NBLK_OPT;
|
||||
|
@ -3562,12 +3562,12 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
errno = e;
|
||||
return 2; /* Couldn't set non-blocking. */
|
||||
}
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
memcpy(&sin, addr, sizeof(sin));
|
||||
if (connect(desc, (struct sockaddr*)&sin, sizeof(sin)) != 0)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
if (WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno == EINPROGRESS)
|
||||
|
@ -3577,7 +3577,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
if (e == -2)
|
||||
{
|
||||
e = errno;
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -3588,7 +3588,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
else if (e == -1)
|
||||
{
|
||||
e = errno;
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -3600,7 +3600,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
else
|
||||
{
|
||||
e = errno;
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -3624,7 +3624,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
e = tryWrite(desc, 10, (uptr)&msg, GDO_REQ_SIZE);
|
||||
if (e != GDO_REQ_SIZE)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3638,7 +3638,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
e = tryRead(desc, 3, (uptr)&port, 4);
|
||||
if (e != 4)
|
||||
{
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3663,7 +3663,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
if (tryRead(desc, 3, b, len) != len)
|
||||
{
|
||||
free(b);
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3689,7 +3689,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
if (tryRead(desc, 3, b, len) != len)
|
||||
{
|
||||
free(b);
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3720,7 +3720,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
}
|
||||
|
||||
*p = (unsigned short)port;
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -4171,7 +4171,7 @@ static void do_help(int argc, char **argv, char *options)
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
static char*
|
||||
quoteArg(const char *arg)
|
||||
{
|
||||
|
@ -4278,7 +4278,7 @@ main(int argc, char** argv)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
|
||||
|
@ -4290,7 +4290,7 @@ main(int argc, char** argv)
|
|||
* Would use inet_aton(), but older systems don't have it.
|
||||
*/
|
||||
loopback.s_addr = inet_addr("127.0.0.1");
|
||||
#ifdef __MINGW__
|
||||
#ifdef __MINGW32__
|
||||
class_a_net = IN_CLASSA_NET;
|
||||
class_a_mask.s_addr = class_a_net;
|
||||
class_b_net = IN_CLASSB_NET;
|
||||
|
@ -4569,7 +4569,7 @@ printf(
|
|||
exit (0);
|
||||
}
|
||||
|
||||
#ifdef __MINGW__ /* On Win32, we don't fork */
|
||||
#ifdef __MINGW32__ /* On Win32, we don't fork */
|
||||
if (nofork == 0)
|
||||
{
|
||||
char **a = malloc((argc+2) * sizeof(char*));
|
||||
|
@ -4667,7 +4667,7 @@ printf(
|
|||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
|
||||
#endif /* !__MINGW__ */
|
||||
#endif /* !__MINGW32__ */
|
||||
|
||||
init_my_port(); /* Determine port to listen on. */
|
||||
init_ports(); /* Create ports to handle requests. */
|
||||
|
@ -4711,7 +4711,7 @@ printf(
|
|||
{
|
||||
FILE *fptr;
|
||||
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
if (getuid () == 0)
|
||||
#endif
|
||||
{
|
||||
|
@ -4728,7 +4728,7 @@ printf(
|
|||
fclose(fptr);
|
||||
chmod(pidfile, 0644);
|
||||
}
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
else
|
||||
{
|
||||
sprintf(ebuf, "Only root user can write to pid file\n");
|
||||
|
@ -4737,7 +4737,7 @@ printf(
|
|||
#endif
|
||||
}
|
||||
{
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
int uid = -2;
|
||||
int gid = -2;
|
||||
#endif
|
||||
|
@ -4758,7 +4758,7 @@ printf(
|
|||
/*
|
||||
* As another level of paranoia - restrict this process to /tmp
|
||||
*/
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
if (chdir("/tmp") < 0)
|
||||
{
|
||||
sprintf(ebuf, "Unable to change directory to /tmp");
|
||||
|
@ -4776,10 +4776,10 @@ printf(
|
|||
}
|
||||
chdir("/");
|
||||
}
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __svr4__ */
|
||||
|
||||
#ifndef __MINGW__
|
||||
#ifndef __MINGW32__
|
||||
/*
|
||||
* Try to become a 'safe' user now that we have
|
||||
* done everything that needs root priv.
|
||||
|
@ -4810,7 +4810,7 @@ printf(
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __MINGW32__ */
|
||||
}
|
||||
|
||||
init_probe(); /* Probe other name servers on net. */
|
||||
|
|
Loading…
Reference in a new issue