hyanantha Thu Oct 24 05:48:07 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/ftp ftp.c Log: NetWare related changes/modifications. Index: php4/ext/ftp/ftp.c diff -u php4/ext/ftp/ftp.c:1.44.2.2 php4/ext/ftp/ftp.c:1.44.2.3 --- php4/ext/ftp/ftp.c:1.44.2.2 Mon Mar 18 18:16:57 2002 +++ php4/ext/ftp/ftp.c Thu Oct 24 05:48:07 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ftp.c,v 1.44.2.2 2002/03/18 23:16:57 vlad Exp $ */ +/* $Id: ftp.c,v 1.44.2.3 2002/10/24 09:48:07 hyanantha Exp $ */ #include "php.h" @@ -33,6 +33,18 @@ #include <time.h> #ifdef PHP_WIN32 #include <winsock.h> +#elif defined(NETWARE) +#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */ +#include <novsock2.h> +#else +#ifdef NEW_LIBC +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> +#else +#include <sys/socket.h> +#endif +#endif #else #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -56,11 +68,16 @@ #include "ext/standard/fsock.h" /* define closesocket macro for portability */ -#ifndef PHP_WIN32 +#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) #undef closesocket #define closesocket close #endif +/* Additional headers for NetWare */ +#if defined(NETWARE) && defined(NEW_LIBC) && !defined(USE_WINSOCK) +#include <sys/select.h> +#endif + /* sends an ftp command, returns true on success, false on error. * it sends the string "cmd args\r\n" if args is non-null, or * "cmd\r\n" if args is null @@ -130,7 +147,7 @@ size = sizeof(ftp->localaddr); memset(&ftp->localaddr, 0, size); - if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) == -1) { + if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, (unsigned +int*)&size) == -1) { perror("getsockname"); goto bail; } @@ -946,7 +963,7 @@ FD_SET(s, &write_set); n = select(s + 1, NULL, &write_set, NULL, &tv); if (n < 1) { -#ifndef PHP_WIN32 +#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) errno = ETIMEDOUT; #endif @@ -981,7 +998,7 @@ FD_SET(s, &read_set); n = select(s + 1, &read_set, NULL, NULL, &tv); if (n < 1) { -#ifndef PHP_WIN32 +#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) errno = ETIMEDOUT; #endif @@ -1008,14 +1025,14 @@ n = select(s + 1, &accept_set, NULL, NULL, &tv); if (n < 1) { -#ifndef PHP_WIN32 +#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) errno = ETIMEDOUT; #endif return -1; } - return accept(s, addr, addrlen); + return accept(s, addr, (unsigned int*)addrlen); } /* }}} */ @@ -1087,7 +1104,7 @@ goto bail; } - if (getsockname(fd, (struct sockaddr*) &addr, &size) == -1) { + if (getsockname(fd, (struct sockaddr*) &addr, (unsigned int*)&size) == -1) { perror("getsockname"); goto bail; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php