View Issue Details

IDProjectCategoryView StatusLast Update
0000614Other Unix PortBugpublic2020-08-24 03:08
Reporterkomh Assigned Topsmedley  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Summary0000614: Patch set for apr-1.4.8
DescriptionI attach a patch set for apr-1.4.8 as a git format.
TagsNo tags attached.
Attached Files
0001-aplibtool-fix-compilation.patch (1,033 bytes)   
From 577e38e14bedfe795ab90be5ef58e2dd0bba1a0f Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Mon, 21 Apr 2014 20:20:30 +0900
Subject: [PATCH 1/5] aplibtool: fix compilation

-----
aplibtool.c: In function `parse_input_file_name':
aplibtool.c:269: error: `pathlen' undeclared (first use in this function)
aplibtool.c:269: error: (Each undeclared identifier is reported only once
aplibtool.c:269: error: for each function it appears in.)
-----
---
 build/aplibtool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/build/aplibtool.c b/build/aplibtool.c
index 31330e8..8c56f9c 100644
--- a/build/aplibtool.c
+++ b/build/aplibtool.c
@@ -266,7 +266,7 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data)
     if (strcmp(ext, "la") == 0) {
         newarg = (char *)malloc(strlen(arg) + 10);
         strcpy(newarg, arg);
-        newarg[pathlen] = 0;
+        newarg[name - arg] = 0;
         strcat(newarg, ".libs/");
 
         if (strncmp(name, "lib", 3) == 0) {
-- 
1.7.3.2

0003-configure.in-set-ECHO-on-OS-2.patch (1,245 bytes)   
From 93ff06fcc642db1a588416d06837cf4ba1fc7d06 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Mon, 21 Apr 2014 20:58:36 +0900
Subject: [PATCH 3/5] configure.in: set ECHO on OS/2

This fixes the problem that config.status reports 'cannot execute' errors.
---
 configure.in |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 655de8d..6346ba1 100644
--- a/configure.in
+++ b/configure.in
@@ -243,6 +243,23 @@ case $host in
     echo "using aplibtool"
     LIBTOOL="$srcdir/build/aplibtool"
     gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c
+    # Determine ECHO
+    # Test print first, because it will be a builtin if present.
+    if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+       test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+        ECHO='print -r --'
+    elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+        ECHO='printf %s\n'
+    else
+        # Use this function as a fallback that always works.
+        func_fallback_echo ()
+        {
+            eval 'cat <<_ACEOF
+$1
+_ACEOF'
+        }
+        ECHO='func_fallback_echo'
+    fi
     ;;
 *)
     if test "x$LTFLAGS" = "x"; then
-- 
1.7.3.2

0004-file_io-initialize-ungetchar-to-1-of-apr_file_t-on-O.patch (1,095 bytes)   
From b2359ae02410fcd780ffc574f25d7fb7cd20d84a Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Wed, 23 Apr 2014 20:42:10 +0900
Subject: [PATCH 4/5] file_io: initialize 'ungetchar' to -1 of apr_file_t on OS/2

---
 file_io/os2/open.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/file_io/os2/open.c b/file_io/os2/open.c
index 0e62cdf..f688e1c 100644
--- a/file_io/os2/open.c
+++ b/file_io/os2/open.c
@@ -100,6 +100,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr
     dafile->buffer = NULL;
     dafile->flags = flag;
     dafile->blocking = BLK_ON;
+    dafile->ungetchar = -1;
     
     if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) {
         mflags |= OPEN_ACCESS_READWRITE;
@@ -259,6 +260,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef
     (*file)->flags = flags;
     (*file)->pipe = FALSE;
     (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0;
+    (*file)->ungetchar = -1;
 
     if ((*file)->buffered) {
         apr_status_t rv;
-- 
1.7.3.2

0005-network_io-fix-SIGSEGV-when-using-32bits-TCP-IP-APIs.patch (4,927 bytes)   
From b317054d8f3ad4d11bfe25507bae4f71ce676d6e Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Wed, 23 Apr 2014 20:44:38 +0900
Subject: [PATCH 5/5] network_io: fix SIGSEGV when using 32bits TCP/IP APIs on OS/2

---
 include/arch/os2/apr_arch_networkio.h |    4 ---
 network_io/os2/os2calls.c             |   42 ++++++++++++++++----------------
 2 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h
index 552811f..10c6de8 100644
--- a/include/arch/os2/apr_arch_networkio.h
+++ b/include/arch/os2/apr_arch_networkio.h
@@ -20,11 +20,7 @@
 #include "apr_private.h"
 #include "apr_network_io.h"
 #include "apr_general.h"
-#ifdef TCPV40HDRS
 #include "apr_arch_os2calls.h"
-#else
-#include <sys/socket.h>
-#endif
 #include "apr_poll.h"
 
 #if APR_HAVE_NETDB_H
diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c
index 1ed61bb..8aaba30 100644
--- a/network_io/os2/os2calls.c
+++ b/network_io/os2/os2calls.c
@@ -122,7 +122,7 @@ static int os2_fn_link()
     return APR_SUCCESS;
 }
 #else
-static HMODULE hTCPIPDLL;
+static HMODULE hTCPIP32;
 
 static int os2_fn_link()
 {
@@ -132,66 +132,66 @@ static int os2_fn_link()
         ULONG rc;
         char errorstr[200];
 
-        rc = DosLoadModule(errorstr, sizeof(errorstr), "TCPIPDLL", &hTCPIPDLL);
+        rc = DosLoadModule(errorstr, sizeof(errorstr), "TCPIP32", &hTCPIP32);
 
         if (rc)
             return APR_OS2_STATUS(rc);
 
-        rc = DosQueryProcAddr(hTCPIPDLL, 0, "SOCKET", &apr_os2_socket);
+        rc = DosQueryProcAddr(hTCPIP32, 0, "SOCKET", &apr_os2_socket);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "SELECT", &apr_os2_select);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "OS2_SELECT", &apr_os2_select);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "SOCK_ERRNO", &apr_os2_sock_errno);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SOCK_ERRNO", &apr_os2_sock_errno);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "ACCEPT", &apr_os2_accept);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "ACCEPT", &apr_os2_accept);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "BIND", &apr_os2_bind);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "BIND", &apr_os2_bind);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "CONNECT", &apr_os2_connect);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "CONNECT", &apr_os2_connect);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "GETPEERNAME", &apr_os2_getpeername);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "GETPEERNAME", &apr_os2_getpeername);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "GETSOCKNAME", &apr_os2_getsockname);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "GETSOCKNAME", &apr_os2_getsockname);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "GETSOCKOPT", &apr_os2_getsockopt);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "GETSOCKOPT", &apr_os2_getsockopt);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "IOCTL", &apr_os2_ioctl);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "IOCTL", &apr_os2_ioctl);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "LISTEN", &apr_os2_listen);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "LISTEN", &apr_os2_listen);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "RECV", &apr_os2_recv);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "RECV", &apr_os2_recv);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "SEND", &apr_os2_send);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SEND", &apr_os2_send);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "SETSOCKOPT", &apr_os2_setsockopt);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SETSOCKOPT", &apr_os2_setsockopt);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "SHUTDOWN", &apr_os2_shutdown);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SHUTDOWN", &apr_os2_shutdown);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "SOCLOSE", &apr_os2_soclose);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SOCLOSE", &apr_os2_soclose);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "WRITEV", &apr_os2_writev);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "WRITEV", &apr_os2_writev);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "SENDTO", &apr_os2_sendto);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SENDTO", &apr_os2_sendto);
 
         if (!rc)
-            rc = DosQueryProcAddr(hTCPIPDLL, 0, "RECVFROM", &apr_os2_recvfrom);
+            rc = DosQueryProcAddr(hTCPIP32, 0, "RECVFROM", &apr_os2_recvfrom);
 
         if (rc)
             return APR_OS2_STATUS(rc);
-- 
1.7.3.2

Activities

psmedley

2014-08-01 09:49

administrator   ~0002791

Applied in local source - thanks!

Issue History

Date Modified Username Field Change
2014-07-10 11:47 komh New Issue
2014-07-10 11:47 komh File Added: 0001-aplibtool-fix-compilation.patch
2014-07-10 11:47 komh File Added: 0003-configure.in-set-ECHO-on-OS-2.patch
2014-07-10 11:47 komh File Added: 0004-file_io-initialize-ungetchar-to-1-of-apr_file_t-on-O.patch
2014-07-10 11:47 komh File Added: 0005-network_io-fix-SIGSEGV-when-using-32bits-TCP-IP-APIs.patch
2014-08-01 09:49 psmedley Note Added: 0002791
2014-08-01 09:49 psmedley Status new => resolved
2014-08-01 09:49 psmedley Resolution open => fixed
2014-08-01 09:49 psmedley Assigned To => psmedley
2020-08-24 03:08 psmedley Status resolved => closed