]> TLD Linux GIT Repositories - packages/apr.git/blob - apr-svn.patch
- upstream fixes
[packages/apr.git] / apr-svn.patch
1 diff -urNp apr-1.5.1/build/config.guess apr/build/config.guess
2 --- apr-1.5.1/build/config.guess        2014-03-08 10:59:15.000000000 +0000
3 +++ apr/build/config.guess      2015-02-05 07:03:17.142489472 +0000
4 @@ -2,7 +2,7 @@
5  # Attempt to guess a canonical system name.
6  #   Copyright 1992-2014 Free Software Foundation, Inc.
7  
8 -timestamp='2014-02-12'
9 +timestamp='2014-03-23'
10  
11  # This file is free software; you can redistribute it and/or modify it
12  # under the terms of the GNU General Public License as published by
13 @@ -826,7 +826,7 @@ EOF
14      *:MINGW*:*)
15         echo ${UNAME_MACHINE}-pc-mingw32
16         exit ;;
17 -    i*:MSYS*:*)
18 +    *:MSYS*:*)
19         echo ${UNAME_MACHINE}-pc-msys
20         exit ;;
21      i*:windows32*:*)
22 @@ -969,10 +969,10 @@ EOF
23         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
24         test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
25         ;;
26 -    or1k:Linux:*:*)
27 -       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
28 +    openrisc*:Linux:*:*)
29 +       echo or1k-unknown-linux-${LIBC}
30         exit ;;
31 -    or32:Linux:*:*)
32 +    or32:Linux:*:* | or1k*:Linux:*:*)
33         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
34         exit ;;
35      padre:Linux:*:*)
36 diff -urNp apr-1.5.1/build/config.sub apr/build/config.sub
37 --- apr-1.5.1/build/config.sub  2014-03-08 10:59:15.000000000 +0000
38 +++ apr/build/config.sub        2015-02-05 07:03:17.140488472 +0000
39 @@ -2,7 +2,7 @@
40  # Configuration validation subroutine script.
41  #   Copyright 1992-2014 Free Software Foundation, Inc.
42  
43 -timestamp='2014-01-01'
44 +timestamp='2014-09-11'
45  
46  # This file is free software; you can redistribute it and/or modify it
47  # under the terms of the GNU General Public License as published by
48 @@ -283,8 +283,10 @@ case $basic_machine in
49         | mips64vr5900 | mips64vr5900el \
50         | mipsisa32 | mipsisa32el \
51         | mipsisa32r2 | mipsisa32r2el \
52 +       | mipsisa32r6 | mipsisa32r6el \
53         | mipsisa64 | mipsisa64el \
54         | mipsisa64r2 | mipsisa64r2el \
55 +       | mipsisa64r6 | mipsisa64r6el \
56         | mipsisa64sb1 | mipsisa64sb1el \
57         | mipsisa64sr71k | mipsisa64sr71kel \
58         | mipsr5900 | mipsr5900el \
59 @@ -296,11 +298,11 @@ case $basic_machine in
60         | nds32 | nds32le | nds32be \
61         | nios | nios2 | nios2eb | nios2el \
62         | ns16k | ns32k \
63 -       | open8 \
64 -       | or1k | or32 \
65 +       | open8 | or1k | or1knd | or32 \
66         | pdp10 | pdp11 | pj | pjl \
67         | powerpc | powerpc64 | powerpc64le | powerpcle \
68         | pyramid \
69 +       | riscv32 | riscv64 \
70         | rl78 | rx \
71         | score \
72         | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
73 @@ -402,8 +404,10 @@ case $basic_machine in
74         | mips64vr5900-* | mips64vr5900el-* \
75         | mipsisa32-* | mipsisa32el-* \
76         | mipsisa32r2-* | mipsisa32r2el-* \
77 +       | mipsisa32r6-* | mipsisa32r6el-* \
78         | mipsisa64-* | mipsisa64el-* \
79         | mipsisa64r2-* | mipsisa64r2el-* \
80 +       | mipsisa64r6-* | mipsisa64r6el-* \
81         | mipsisa64sb1-* | mipsisa64sb1el-* \
82         | mipsisa64sr71k-* | mipsisa64sr71kel-* \
83         | mipsr5900-* | mipsr5900el-* \
84 @@ -415,6 +419,7 @@ case $basic_machine in
85         | nios-* | nios2-* | nios2eb-* | nios2el-* \
86         | none-* | np1-* | ns16k-* | ns32k-* \
87         | open8-* \
88 +       | or1k*-* \
89         | orion-* \
90         | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
91         | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
92 @@ -824,6 +829,10 @@ case $basic_machine in
93                 basic_machine=powerpc-unknown
94                 os=-morphos
95                 ;;
96 +       moxiebox)
97 +               basic_machine=moxie-unknown
98 +               os=-moxiebox
99 +               ;;
100         msdos)
101                 basic_machine=i386-pc
102                 os=-msdos
103 @@ -1369,14 +1378,14 @@ case $os in
104               | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
105               | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
106               | -linux-newlib* | -linux-musl* | -linux-uclibc* \
107 -             | -uxpv* | -beos* | -mpeix* | -udk* \
108 +             | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
109               | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
110               | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
111               | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
112               | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
113               | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
114               | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
115 -             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
116 +             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
117         # Remember, each alternative MUST END IN *, to match a version number.
118                 ;;
119         -qnx*)
120 @@ -1594,9 +1603,6 @@ case $basic_machine in
121         mips*-*)
122                 os=-elf
123                 ;;
124 -       or1k-*)
125 -               os=-elf
126 -               ;;
127         or32-*)
128                 os=-coff
129                 ;;
130 diff -urNp apr-1.5.1/build/nw_export.inc apr/build/nw_export.inc
131 --- apr-1.5.1/build/nw_export.inc       2005-10-28 16:40:38.000000000 +0000
132 +++ apr/build/nw_export.inc     2015-02-05 07:03:17.143489972 +0000
133 @@ -15,6 +15,7 @@
134  #include "apr_dso.h"
135  #include "apr_env.h"
136  #include "apr_errno.h"
137 +#include "apr_escape.h"
138  #include "apr_file_info.h"
139  #include "apr_file_io.h"
140  #include "apr_fnmatch.h"
141 @@ -34,6 +35,7 @@
142  #include "apr_random.h"
143  #include "apr_shm.h"
144  #include "apr_signal.h"
145 +#include "apr_skiplist.h"
146  #include "apr_strings.h"
147  #include "apr_support.h"
148  #include "apr_tables.h"
149 diff -urNp apr-1.5.1/CHANGES apr/CHANGES
150 --- apr-1.5.1/CHANGES   2014-04-15 23:29:09.000000000 +0000
151 +++ apr/CHANGES 2015-02-05 07:03:17.391613971 +0000
152 @@ -1,4 +1,28 @@
153                                                       -*- coding: utf-8 -*-
154 +Changes for APR 1.5.2
155 +
156 +  *) apr_pollset: On z/OS, threadsafe apr_pollset_poll() may return
157 +     "EDC8102I Operation would block" under load.
158 +     [Pat Odonnell <patod us.ibm.com>]
159 +
160 +  *) On z/OS, apr_sockaddr_info_get() with family == APR_UNSPEC was not 
161 +     returning IPv4 addresses if any IPv6 addresses were returned. 
162 +     [Eric Covener]
163 +
164 +  *) Windows cmake build: Fix an incompatibility with cmake 2.8.12 and
165 +     later.  [Jeff Trawick]
166 +
167 +  *) apr_global_mutex/apr_proc_mutex: Resolve failures with the 
168 +     POSIX sem implementation in environments which receive signals.
169 +     [Jeff Trawick]
170 +
171 +  *) apr_skiplist: Fix potential corruption of skiplists leading to 
172 +     results or crashes. [Takashi Sato <takashi tks st>, Eric Covener]
173 +     PR 56654.
174 +
175 +  *) Improve platform detection by updating config.guess and config.sub.
176 +     [Rainer Jung]
177 +
178  Changes for APR 1.5.1
179  
180    *) apr_os_proc_mutex_get() on Unix:  Avoid segfault for cross-
181 @@ -37,8 +61,8 @@ Changes for APR 1.5.1
182    *) Correct a regression in 1.5.0 which affected out-of-tree
183       builds on Unix.  [Rainer Jung]
184  
185 -  *) Improve platform detection for bundled expat by updating
186 -     config.guess and config.sub. [Rainer Jung]
187 +  *) Improve platform detection by updating config.guess and config.sub.
188 +     [Rainer Jung]
189  
190  Changes for APR 1.5.0
191  
192 diff -urNp apr-1.5.1/CMakeLists.txt apr/CMakeLists.txt
193 --- apr-1.5.1/CMakeLists.txt    2014-01-20 14:16:10.000000000 +0000
194 +++ apr/CMakeLists.txt  2015-02-05 07:03:16.646241471 +0000
195 @@ -234,6 +234,7 @@ SET(APR_TEST_SOURCES
196    test/testprocmutex.c
197    test/testrand.c
198    test/testshm.c
199 +  test/testskiplist.c
200    test/testsleep.c
201    test/testsock.c
202    test/testsockets.c
203 @@ -252,7 +253,6 @@ SET(APR_TEST_SOURCES
204  
205  SET(install_targets)
206  SET(install_bin_pdb)
207 -SET(install_lib_pdb)
208  
209  # libapr-1 is shared, apr-1 is static
210  ADD_LIBRARY(libapr-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc)
211 @@ -264,7 +264,6 @@ ADD_DEPENDENCIES(libapr-1 test_char_head
212  
213  ADD_LIBRARY(apr-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
214  SET(install_targets ${install_targets} apr-1)
215 -SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/apr-1.pdb)
216  TARGET_LINK_LIBRARIES(apr-1 ${APR_SYSTEM_LIBS})
217  SET_TARGET_PROPERTIES(apr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;WINNT")
218  ADD_DEPENDENCIES(apr-1 test_char_header)
219 @@ -272,12 +271,10 @@ ADD_DEPENDENCIES(apr-1 test_char_header)
220  # libaprapp-1 and aprapp-1 are static
221  ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
222  SET(install_targets ${install_targets} libaprapp-1)
223 -SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/libaprapp-1.pdb)
224  SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT")
225  
226  ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
227  SET(install_targets ${install_targets} aprapp-1)
228 -SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/aprapp-1.pdb)
229  SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT")
230  
231  IF(APR_BUILD_TESTAPR)
232 @@ -394,10 +391,6 @@ IF(INSTALL_PDB)
233    INSTALL(FILES ${install_bin_pdb}
234            DESTINATION bin
235            CONFIGURATIONS RelWithDebInfo Debug)
236 -
237 -  INSTALL(FILES ${install_lib_pdb}
238 -          DESTINATION lib
239 -          CONFIGURATIONS RelWithDebInfo Debug)
240  ENDIF()
241  
242  INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include)
243 diff -urNp apr-1.5.1/include/apr_skiplist.h apr/include/apr_skiplist.h
244 --- apr-1.5.1/include/apr_skiplist.h    2013-11-17 18:27:39.000000000 +0000
245 +++ apr/include/apr_skiplist.h  2015-02-05 07:03:16.824330472 +0000
246 @@ -229,7 +229,7 @@ APR_DECLARE(void) apr_skiplist_remove_al
247  APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree);
248  
249  /**
250 - * Return the first element in the skip list, leaving the element in the skip list.
251 + * Return the first element in the skip list, removing the element from the skip list.
252   * @param sl The skip list
253   * @param myfree A function to be called for the removed element
254   * @remark NULL will be returned if there are no elements
255 diff -urNp apr-1.5.1/locks/unix/proc_mutex.c apr/locks/unix/proc_mutex.c
256 --- apr-1.5.1/locks/unix/proc_mutex.c   2014-04-13 18:13:41.000000000 +0000
257 +++ apr/locks/unix/proc_mutex.c 2015-02-05 07:03:17.394615472 +0000
258 @@ -114,7 +114,9 @@ static apr_status_t proc_mutex_posix_cre
259          usec = apr_time_usec(now);
260          apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec);
261      }
262 -    psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1);
263 +    do {
264 +        psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1);
265 +    } while (psem == (sem_t *)SEM_FAILED && errno == EINTR);
266      if (psem == (sem_t *)SEM_FAILED) {
267          if (errno == ENAMETOOLONG) {
268              /* Oh well, good try */
269 @@ -122,7 +124,9 @@ static apr_status_t proc_mutex_posix_cre
270          } else {
271              return errno;
272          }
273 -        psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1);
274 +        do {
275 +            psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1);
276 +        } while (psem == (sem_t *)SEM_FAILED && errno == EINTR);
277      }
278  
279      if (psem == (sem_t *)SEM_FAILED) {
280 @@ -140,7 +144,12 @@ static apr_status_t proc_mutex_posix_cre
281  
282  static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex)
283  {
284 -    if (sem_wait(mutex->psem_interproc) < 0) {
285 +    int rc;
286 +
287 +    do {
288 +        rc = sem_wait(mutex->psem_interproc);
289 +    } while (rc < 0 && errno == EINTR);
290 +    if (rc < 0) {
291          return errno;
292      }
293      mutex->curr_locked = 1;
294 @@ -149,7 +158,12 @@ static apr_status_t proc_mutex_posix_acq
295  
296  static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex)
297  {
298 -    if (sem_trywait(mutex->psem_interproc) < 0) {
299 +    int rc;
300 +
301 +    do {
302 +        rc = sem_trywait(mutex->psem_interproc);
303 +    } while (rc < 0 && errno == EINTR);
304 +    if (rc < 0) {
305          if (errno == EAGAIN) {
306              return APR_EBUSY;
307          }
308 diff -urNp apr-1.5.1/Makefile.in apr/Makefile.in
309 --- apr-1.5.1/Makefile.in       2014-03-17 15:10:26.000000000 +0000
310 +++ apr/Makefile.in     2015-02-05 07:03:17.325580971 +0000
311 @@ -129,11 +129,11 @@ check: $(TARGET_LIB)
312  etags:
313         etags `find . -name '*.[ch]'`
314  
315 -make_tools_dir:
316 +OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
317 +tools/gen_test_char.lo: tools/gen_test_char.c
318         $(APR_MKDIR) tools
319 +       $(LT_COMPILE)
320  
321 -OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
322 -tools/gen_test_char.lo: make_tools_dir
323  tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
324         $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
325  
326 diff -urNp apr-1.5.1/memory/unix/apr_pools.c apr/memory/unix/apr_pools.c
327 --- apr-1.5.1/memory/unix/apr_pools.c   2011-10-15 21:26:14.000000000 +0000
328 +++ apr/memory/unix/apr_pools.c 2015-02-05 07:03:17.389612972 +0000
329 @@ -1135,21 +1135,12 @@ APR_DECLARE(char *) apr_pvsprintf(apr_po
330       * room to hold the NUL terminator.
331       */
332      if (ps.node->first_avail == ps.node->endp) {
333 -        if (psprintf_flush(&ps.vbuff) == -1) {
334 -            if (pool->abort_fn) {
335 -                pool->abort_fn(APR_ENOMEM);
336 -            }
337 -
338 -            return NULL;
339 -        }
340 +        if (psprintf_flush(&ps.vbuff) == -1)
341 +           goto error;
342      }
343  
344 -    if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) {
345 -        if (pool->abort_fn)
346 -            pool->abort_fn(APR_ENOMEM);
347 -
348 -        return NULL;
349 -    }
350 +    if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1)
351 +        goto error;
352  
353      strp = ps.vbuff.curpos;
354      *strp++ = '\0';
355 @@ -1195,6 +1186,15 @@ APR_DECLARE(char *) apr_pvsprintf(apr_po
356      list_insert(active, node);
357  
358      return strp;
359 +
360 +error:
361 +    if (pool->abort_fn)
362 +        pool->abort_fn(APR_ENOMEM);
363 +    if (ps.got_a_new_node) {
364 +        ps.node->next = ps.free;
365 +        allocator_free(pool->allocator, ps.node);
366 +    }
367 +    return NULL;
368  }
369  
370  
371 diff -urNp apr-1.5.1/misc/unix/errorcodes.c apr/misc/unix/errorcodes.c
372 --- apr-1.5.1/misc/unix/errorcodes.c    2011-03-21 16:55:11.000000000 +0000
373 +++ apr/misc/unix/errorcodes.c  2015-02-05 07:03:17.030433472 +0000
374 @@ -39,6 +39,8 @@ static char *stuffbuffer(char *buf, apr_
375  static char *apr_error_string(apr_status_t statcode)
376  {
377      switch (statcode) {
378 +    case APR_ENOSTAT:
379 +        return "Could not perform a stat on the file.";
380      case APR_ENOPOOL:
381          return "A new pool could not be created.";
382      case APR_EBADDATE:
383 @@ -73,7 +75,10 @@ static char *apr_error_string(apr_status
384          return "The specified IP address is invalid.";
385      case APR_EBADMASK:
386          return "The specified network mask is invalid.";
387 -
388 +    case APR_ESYMNOTFOUND:
389 +        return "Could not find the requested symbol.";
390 +    case APR_ENOTENOUGHENTROPY:
391 +        return "Not enough entropy to continue.";
392      case APR_INCHILD:
393          return
394             "Your code just forked, and you are currently executing in the "
395 @@ -128,10 +133,12 @@ static char *apr_error_string(apr_status
396          return "The given path is misformatted or contained invalid characters";
397      case APR_EPATHWILD:
398          return "The given path contained wildcard characters";
399 +    case APR_EBUSY:
400 +        return "The given lock was busy.";
401      case APR_EPROC_UNKNOWN:
402          return "The process is not recognized.";
403      case APR_EGENERAL:
404 -        return "Internal error";
405 +        return "Internal error (specific information not available)";
406      default:
407          return "Error string not specified yet";
408      }
409 diff -urNp apr-1.5.1/network_io/unix/sockaddr.c apr/network_io/unix/sockaddr.c
410 --- apr-1.5.1/network_io/unix/sockaddr.c        2013-11-12 14:26:22.000000000 +0000
411 +++ apr/network_io/unix/sockaddr.c      2015-02-05 07:03:16.784310472 +0000
412 @@ -325,6 +325,16 @@ static apr_status_t call_resolver(apr_so
413          hints.ai_flags = AI_ADDRCONFIG;
414      }
415  #endif
416 +
417 +#ifdef __MVS__
418 +    /* z/OS will not return IPv4 address under AF_UNSPEC if any IPv6 results 
419 +     * are returned, w/o AI_ALL. 
420 +     */
421 +    if (family == APR_UNSPEC) { 
422 +       hints.ai_flags |= AI_ALL;
423 +    }
424 +#endif
425 +
426      if(hostname == NULL) {
427  #ifdef AI_PASSIVE 
428          /* If hostname is NULL, assume we are trying to bind to all
429 diff -urNp apr-1.5.1/poll/unix/z_asio.c apr/poll/unix/z_asio.c
430 --- apr-1.5.1/poll/unix/z_asio.c        2014-01-25 18:22:55.000000000 +0000
431 +++ apr/poll/unix/z_asio.c      2015-02-05 07:03:17.253544972 +0000
432 @@ -379,6 +379,7 @@ static apr_status_t asio_pollset_add(apr
433              APR_RING_REMOVE(elem, link);
434              DBG1(3, "used recycled memory at %08p\n", elem);
435              elem->state = ASIO_INIT;
436 +            elem->a.aio_cflags = 0;
437          }
438          else {
439              elem = (asio_elem_t *) apr_pcalloc(pollset->pool, sizeof(asio_elem_t));
440 @@ -659,6 +660,7 @@ static apr_status_t asio_pollset_poll(ap
441              if (ret == 1) {
442                  DBG(4, "asyncio() completed inline\n");
443                  /* it's ready now */
444 +                elem->state = ASIO_COMPLETE;
445                  APR_RING_INSERT_TAIL(&(priv->ready_ring), elem, asio_elem_t,
446                                       link);
447              }
448 diff -urNp apr-1.5.1/tables/apr_skiplist.c apr/tables/apr_skiplist.c
449 --- apr-1.5.1/tables/apr_skiplist.c     2013-09-30 13:01:21.000000000 +0000
450 +++ apr/tables/apr_skiplist.c   2015-02-05 07:03:17.392614471 +0000
451 @@ -387,11 +387,9 @@ APR_DECLARE(apr_skiplistnode *) apr_skip
452              (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode));
453          sl->top->up->down = sl->top;
454          sl->top = sl->topend = sl->top->up;
455 -#if 0
456          sl->top->prev = sl->top->next = sl->top->nextindex =
457              sl->top->previndex = sl->top->up = NULL;
458          sl->top->data = NULL;
459 -#endif
460          sl->top->sl = sl;
461      }
462      ch = sl->height;
463 diff -urNp apr-1.5.1/test/abts_tests.h apr/test/abts_tests.h
464 --- apr-1.5.1/test/abts_tests.h 2013-10-09 21:24:03.000000000 +0000
465 +++ apr/test/abts_tests.h       2015-02-05 07:03:16.655245972 +0000
466 @@ -67,7 +67,8 @@ const struct testlist {
467      {testtime},
468      {testud},
469      {testuser},
470 -    {testvsn}
471 +    {testvsn},
472 +    {testskiplist}
473  };
474  
475  #endif /* APR_TEST_INCLUDES */
476 diff -urNp apr-1.5.1/test/Makefile.in apr/test/Makefile.in
477 --- apr-1.5.1/test/Makefile.in  2013-10-10 21:31:21.000000000 +0000
478 +++ apr/test/Makefile.in        2015-02-05 07:03:16.648242471 +0000
479 @@ -29,7 +29,7 @@ TESTS = testtime.lo teststr.lo testvsn.l
480         testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \
481         testenv.lo testprocmutex.lo testfnmatch.lo testatomic.lo testflock.lo \
482         testsock.lo testglobalmutex.lo teststrnatcmp.lo testfilecopy.lo \
483 -       testtemp.lo testlfs.lo testcond.lo testescape.lo
484 +       testtemp.lo testlfs.lo testcond.lo testescape.lo testskiplist.lo
485  
486  OTHER_PROGRAMS = \
487         echod@EXEEXT@ \
488 diff -urNp apr-1.5.1/test/testskiplist.c apr/test/testskiplist.c
489 --- apr-1.5.1/test/testskiplist.c       1970-01-01 00:00:00.000000000 +0000
490 +++ apr/test/testskiplist.c     2015-02-05 07:03:16.741288971 +0000
491 @@ -0,0 +1,100 @@
492 +/* Licensed to the Apache Software Foundation (ASF) under one or more
493 + * contributor license agreements.  See the NOTICE file distributed with
494 + * this work for additional information regarding copyright ownership.
495 + * The ASF licenses this file to You under the Apache License, Version 2.0
496 + * (the "License"); you may not use this file except in compliance with
497 + * the License.  You may obtain a copy of the License at
498 + *
499 + *     http://www.apache.org/licenses/LICENSE-2.0
500 + *
501 + * Unless required by applicable law or agreed to in writing, software
502 + * distributed under the License is distributed on an "AS IS" BASIS,
503 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
504 + * See the License for the specific language governing permissions and
505 + * limitations under the License.
506 + */
507 +
508 +#include "testutil.h"
509 +#include "apr.h"
510 +#include "apr_strings.h"
511 +#include "apr_general.h"
512 +#include "apr_pools.h"
513 +#include "apr_skiplist.h"
514 +#if APR_HAVE_STDIO_H
515 +#include <stdio.h>
516 +#endif
517 +#if APR_HAVE_STDLIB_H
518 +#include <stdlib.h>
519 +#endif
520 +#if APR_HAVE_STRING_H
521 +#include <string.h>
522 +#endif
523 +
524 +static void add_int_to_skiplist(apr_skiplist *list, int n){
525 +    int* a = apr_skiplist_alloc(list, sizeof(int));
526 +    *a = n;
527 +    apr_skiplist_insert(list, a);
528 +}
529 +
530 +static int comp(void *a, void *b){
531 +    return *((int*) a) - *((int*) b);
532 +}
533 +
534 +
535 +static int compk(void *a, void *b){
536 +    return comp(a, b);
537 +}
538 +
539 +static void skiplist_test(abts_case *tc, void *data) {
540 +    int test_elems = 10;
541 +    int i = 0, j = 0;
542 +    int *val = NULL;
543 +    apr_skiplist * list = NULL;
544 +    apr_pool_t *p;
545 +
546 +    apr_pool_create(&p, NULL);
547 +    apr_skiplist_init(&list, p);
548 +    apr_skiplist_set_compare(list, comp, compk);
549 +    
550 +    /* insert 10 objects */
551 +    for (i = 0; i < test_elems; ++i){
552 +        add_int_to_skiplist(list, i);
553 +    }
554 +
555 +    /* remove all objects */
556 +    while ((val = apr_skiplist_pop(list, NULL))){
557 +        ABTS_INT_EQUAL(tc, *val, j++);
558 +    }
559 +
560 +    /* insert 10 objects again */
561 +    for (i = test_elems; i < test_elems+test_elems; ++i){
562 +        add_int_to_skiplist(list, i);
563 +    }
564 +
565 +    j = test_elems;
566 +    while ((val = apr_skiplist_pop(list, NULL))){
567 +        ABTS_INT_EQUAL(tc, *val, j++);
568 +    }
569 +
570 +    /* empty */
571 +    val = apr_skiplist_pop(list, NULL);
572 +    ABTS_PTR_EQUAL(tc, val, NULL);
573 +
574 +    add_int_to_skiplist(list, 42);
575 +    val = apr_skiplist_pop(list, NULL);
576 +    ABTS_INT_EQUAL(tc, *val, 42); 
577 +
578 +    /* empty */
579 +    val = apr_skiplist_pop(list, NULL);
580 +    ABTS_PTR_EQUAL(tc, val, NULL);
581 +}
582 +
583 +abts_suite *testskiplist(abts_suite *suite)
584 +{
585 +    suite = ADD_SUITE(suite)
586 +
587 +    abts_run_test(suite, skiplist_test, NULL);
588 +
589 +    return suite;
590 +}
591 +
592 diff -urNp apr-1.5.1/test/testutil.h apr/test/testutil.h
593 --- apr-1.5.1/test/testutil.h   2013-10-09 21:24:03.000000000 +0000
594 +++ apr/test/testutil.h 2015-02-05 07:03:16.671253971 +0000
595 @@ -103,5 +103,6 @@ abts_suite *testtime(abts_suite *suite);
596  abts_suite *testud(abts_suite *suite);
597  abts_suite *testuser(abts_suite *suite);
598  abts_suite *testvsn(abts_suite *suite);
599 +abts_suite *testskiplist(abts_suite *suite);
600  
601  #endif /* APR_TEST_INCLUDES */
602 diff -urNp apr-1.5.1/threadproc/netware/thread.c apr/threadproc/netware/thread.c
603 --- apr-1.5.1/threadproc/netware/thread.c       2011-02-18 11:24:40.000000000 +0000
604 +++ apr/threadproc/netware/thread.c     2015-02-05 07:03:17.006421471 +0000
605 @@ -77,7 +77,7 @@ apr_status_t apr_thread_create(apr_threa
606                                 apr_pool_t *pool)
607  {
608      apr_status_t stat;
609 -    long flags = NX_THR_BIND_CONTEXT;
610 +    unsigned long flags = NX_THR_BIND_CONTEXT;
611      char threadName[NX_MAX_OBJECT_NAME_LEN+1];
612      size_t stack_size = APR_DEFAULT_STACK_SIZE;
613  
614 @@ -120,8 +120,8 @@ apr_status_t apr_thread_create(apr_threa
615          /* void(*start_routine)(void *arg) */ (void (*)(void *)) dummy_worker,
616          /* void *arg */                       (*new),
617          /* int priority */                    NX_PRIO_MED,
618 -        /* NXSize_t stackSize */              stack_size,
619 -        /* long flags */                      NX_CTX_NORMAL,
620 +        /* size_t stackSize */                stack_size,
621 +        /* unsigned long flags */             NX_CTX_NORMAL,
622          /* int *error */                      &stat);
623  
624      stat = NXContextSetName(
625 @@ -130,7 +130,7 @@ apr_status_t apr_thread_create(apr_threa
626  
627      stat = NXThreadCreate(
628          /* NXContext_t context */     (*new)->ctx,
629 -        /* long flags */              flags,
630 +        /* unsigned long flags */     flags,
631          /* NXThreadId_t *thread_id */ &(*new)->td);
632  
633      if (stat == 0)