From 281f8ff4315aa0a15251dfeb15d0963596ec46bf Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sun, 24 Sep 2000 08:12:14 +0000 Subject: [PATCH] Got an OSF/1 bug report fixing related problems: - xmlversion.h.in nanoftp.c nanohttp.c: traying to work out the problem of socklen_t being undefined on a number of platforms - debugXML.c: fixed a compilation problem when without snprintf Daniel --- ChangeLog | 6 ++++++ debugXML.c | 2 +- include/libxml/xmlversion.h.in | 10 ++++++++++ nanoftp.c | 6 +++++- nanohttp.c | 6 +++++- xmlversion.h.in | 10 ++++++++++ 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37e9a732..5d166a0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Sep 24 10:00:49 CEST 2000 Daniel Veillard + + * xmlversion.h.in nanoftp.c nanohttp.c: traying to work out the + problem of socklen_t being undefined on a number of platforms + * debugXML.c: fixed a compilation problem when without snprintf + Sat Sep 23 12:19:45 CEST 2000 Daniel Veillard * HTMLparser.c uri.c: Another patch from Wayne Davison, correcting diff --git a/debugXML.c b/debugXML.c index 9ee32989..5897c6a8 100644 --- a/debugXML.c +++ b/debugXML.c @@ -1596,7 +1596,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, #ifdef HAVE_SNPRINTF snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name); #else - sprintf(buf, "%s > ", ctxt->node->name); + sprintf(prompt, "%s > ", ctxt->node->name); #endif else sprintf(prompt, "? > "); diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index c0544e6d..6b41be44 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -22,6 +22,16 @@ extern void xmlCheckVersion(int version); #define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" #define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); +/* + * a few extra config stuff which may not be handled easily in configure + */ + +#ifndef HAVE_SOCKLEN_T +#if defined(__osf__) || defined(__Linux__) +#define HAVE_SOCKLEN_T +#endif +#endif + /* * Whether the FTP support is configured in */ diff --git a/nanoftp.c b/nanoftp.c index 55ccb3a1..769628c0 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -1244,7 +1244,11 @@ xmlNanoFTPGetConnection(void *ctx) { unsigned char ad[6], *adp, *portp; unsigned int temp[6]; struct sockaddr_in dataAddr; - size_t dataAddrLen; +#ifdef HAVE_SOCKLEN_T + socklen_t dataAddrLen; +#else + unsigned int dataAddrLen; +#endif ctxt->dataFd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); if (ctxt->dataFd < 0) { diff --git a/nanohttp.c b/nanohttp.c index 52a6b59d..f5fa0442 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -644,7 +644,11 @@ xmlNanoHTTPConnectAttempt(struct in_addr ia, int port) } if ( FD_ISSET(s, &wfd) ) { - unsigned int len; /* was socklen_t barfed on some systems :-( */ +#ifdef HAVE_SOCKLEN_T + socklen_t len; +#else + unsigned int len; +#endif len = sizeof(status); if (getsockopt(s, SOL_SOCKET, SO_ERROR, &status, &len) < 0 ) { /* Solaris error code */ diff --git a/xmlversion.h.in b/xmlversion.h.in index c0544e6d..6b41be44 100644 --- a/xmlversion.h.in +++ b/xmlversion.h.in @@ -22,6 +22,16 @@ extern void xmlCheckVersion(int version); #define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" #define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); +/* + * a few extra config stuff which may not be handled easily in configure + */ + +#ifndef HAVE_SOCKLEN_T +#if defined(__osf__) || defined(__Linux__) +#define HAVE_SOCKLEN_T +#endif +#endif + /* * Whether the FTP support is configured in */