]> granicus.if.org Git - php/commitdiff
Fix Windows & thread-safe build
authorZeev Suraski <zeev@php.net>
Sat, 13 Jan 2001 13:02:19 +0000 (13:02 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 13 Jan 2001 13:02:19 +0000 (13:02 +0000)
ext/standard/http_fopen_wrapper.c
main/network.c

index f4eabe845ef759b577026f3add801275cdd681b9..1d540408a9d622d33802c73a68ca2c7fe36f7c79 100644 (file)
@@ -270,9 +270,9 @@ FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock,
                free_url(resource);
                if (location[0] != '\0') {
                        zval **response_header_new, *entry, **entryp;
+                       ELS_FETCH();
 
                        fp = php_fopen_url_wrap_http(location, mode, options, issock, socketd, opened_path);
-                       ELS_FETCH();
                        if (zend_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &response_header_new) == SUCCESS) {
                                entryp = &entry;
                                MAKE_STD_ZVAL(entry);
index 8a73fff0c3e6eb380bd9000abe2addaf901fed4c..7b6bfda0226ddd4596b56c9e535ba9441505ac22 100644 (file)
@@ -59,11 +59,13 @@ int          inet_aton(const char *, struct in_addr *);
 # define SOCK_CONN_ERR -1
 #endif
 
+#ifdef HAVE_GETADDRINFO
 #ifdef HAVE_GAI_STRERROR
 #  define PHP_GAI_STRERROR(x) (gai_strerror(x))
 #else
 #  define PHP_GAI_STRERROR(x) (php_gai_strerror(x))
-static char *php_gai_strerror(int code) {
+static char *php_gai_strerror(int code)
+{
         static struct {
                 int code;
                 const char *msg;
@@ -96,6 +98,7 @@ static char *php_gai_strerror(int code) {
         return "Unknown error";
 }
 #endif
+#endif
 
 static void php_network_freeaddresses(struct sockaddr **sal)
 {