[Pkg-apache-commits] [SCM] Debian packaging for the apr (Apache Portable Runtime) package branch, master, updated. 63d7300cd2cff1141bc91b91a83a36e367628c7f
Stefan Fritsch
sf at sfritsch.de
Mon May 28 14:16:10 UTC 2012
The following commit has been merged in the master branch:
commit a89cf14db8b25d072359687d2905c9b240e10cd3
Author: Stefan Fritsch <sf at sfritsch.de>
Date: Mon May 28 15:53:53 2012 +0200
Pull updates from upstream 1.4.x branch
Adds the fix for #500558 and #629899
The following patches have been integrated upstream:
- hurd_fix-hints.patch
- sendfile_hurd.patch
diff --git a/debian/changelog b/debian/changelog
index 8626aa9..9ef78a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
apr (1.4.6-3) UNRELEASED; urgency=low
+ * Fix some issues with resolving loopback addresses of a protocol family
+ that is not otherwise configured on a host. Many thanks to Jean-Michel
+ Vourgère and Aurelien Jarno for debugging this.
+ Closes: #500558, #629899 LP: #397393
+ * Pull updates from upstream branch 1.4.x up to r1343251
* Add some debug output in order to debug test failures on kfreebsd-i386.
-- Stefan Fritsch <sf at debian.org> Mon, 28 May 2012 13:10:04 +0200
diff --git a/debian/patches/hurd_fix-hints.patch b/debian/patches/hurd_fix-hints.patch
deleted file mode 100644
index 085695c..0000000
--- a/debian/patches/hurd_fix-hints.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Pino Toscano <pino at debian.org>
-Bug: #656880
-# * hurd_fix-hints.diff
-# This patch, which could be sent upstream, fixes the set of predefined
-# hints for Hurd: usually the $host string is "i686-unknown-gnu0.3" or
-# "i486-pc-gnu", so the "GNU" string won't match anywhere; furthermore,
-# since the proposed string could be too broad (potentially matching
-# also the kFreeBSD string, e.g. "i686-unknown-kfreebsd8.2-gnu"), it has
-# been moved as very last check.
-#
-# committed upstream for 1.4.7
-
-Index: apr/build/apr_hints.m4
-===================================================================
---- apr.orig/build/apr_hints.m4
-+++ apr/build/apr_hints.m4
-@@ -129,9 +129,6 @@
- esac
- APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
- ;;
-- *-GNU*)
-- APR_ADDTO(CPPFLAGS, [-DHURD -D_GNU_SOURCE])
-- ;;
- *-lynx-lynxos)
- APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS])
- APR_ADDTO(LIBS, [-lbsd])
-@@ -479,6 +476,9 @@
- ;;
- esac
- ;;
-+ *-*-gnu*)
-+ APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
-+ ;;
- esac
-
- fi
diff --git a/debian/patches/sendfile_hurd.patch b/debian/patches/sendfile_hurd.patch
deleted file mode 100644
index 312edae..0000000
--- a/debian/patches/sendfile_hurd.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-From: <tfheen at debian.org>
-Subject: No description.
-
----
- network_io/unix/sendrecv.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: apr/network_io/unix/sendrecv.c
-===================================================================
---- apr.orig/network_io/unix/sendrecv.c
-+++ apr/network_io/unix/sendrecv.c
-@@ -245,7 +245,7 @@
- /* Define a structure to pass in when we have a NULL header value */
- static apr_hdtr_t no_hdtr;
-
--#if defined(__linux__) && defined(HAVE_WRITEV)
-+#if (defined(__linux__) || defined(__GNU__)) && defined(HAVE_WRITEV)
-
- apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
- apr_hdtr_t *hdtr, apr_off_t *offset,
diff --git a/debian/patches/series b/debian/patches/series
index 7626fe3..1323b5e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,10 +1,9 @@
fix_apr-config.patch
ship_find_apr.m4.patch
fix-apr.pc.patch
-sendfile_hurd.patch
hurd_path_max.patch
fix_doxygen.patch
omit_extra_libs.patch
hurd_shm_flock.patch
-hurd_fix-hints.patch
debug-kfreebsd-issues.patch
+updates-from-1.4.x-branch.patch
diff --git a/debian/patches/updates-from-1.4.x-branch.patch b/debian/patches/updates-from-1.4.x-branch.patch
new file mode 100644
index 0000000..c6453cb
--- /dev/null
+++ b/debian/patches/updates-from-1.4.x-branch.patch
@@ -0,0 +1,635 @@
+Pull https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x up to r1343251:
+
+ *) Add various gcc function attributes. [Stefan Fritsch]
+
+ *) Fix some problems in apr_sockaddr_info_get() when trying to resolve
+ the loopback addresses of a protocol family that is not otherwise
+ configured on the system. PR 52709. [Nirgal Vourgère
+ <jmv_deb nirgal com>, Stefan Fritsch]
+
+ *) Fix file not being unlocked if truncate call on a file fails.
+ [Mladen Turk]
+
+ *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte
+ instead integer for setsockopt. [Mladen Turk]
+
+ *) Windows: Fix compile-time checks for 64-bit builds, resolving a
+ crash in httpd's mod_rewrite. PR 49155. [<anindyabaruah gmail.com>]
+
+This also includes various hurd build fixes
+
+Index: apr/test/testsockets.c
+===================================================================
+--- apr.orig/test/testsockets.c
++++ apr/test/testsockets.c
+@@ -131,6 +131,10 @@
+ APR_ASSERT_SUCCESS(tc, "Could not bind socket", rv);
+ if (rv != APR_SUCCESS)
+ return;
++ rv = apr_mcast_hops(sock, 10);
++ APR_ASSERT_SUCCESS(tc, "Could not set multicast hops", rv);
++ if (rv != APR_SUCCESS)
++ return;
+
+ rv = apr_socket_bind(sock2, from);
+ APR_ASSERT_SUCCESS(tc, "Could not bind second socket", rv);
+Index: apr/network_io/unix/multicast.c
+===================================================================
+--- apr.orig/network_io/unix/multicast.c
++++ apr/network_io/unix/multicast.c
+@@ -194,7 +194,7 @@
+ }
+
+ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock,
+- apr_byte_t value)
++ apr_uint32_t value)
+ {
+ apr_status_t rv = APR_SUCCESS;
+
+@@ -205,24 +205,19 @@
+ }
+ }
+ #if APR_HAVE_IPV6
+- else if (sock_is_ipv6(sock) && type == IP_MULTICAST_LOOP) {
+- unsigned int loopopt = value;
+- type = IPV6_MULTICAST_LOOP;
+- if (setsockopt(sock->socketdes, IPPROTO_IPV6, type,
+- (const void *) &loopopt, sizeof(loopopt)) == -1) {
+- rv = errno;
+- }
+- }
+ else if (sock_is_ipv6(sock)) {
+ if (type == IP_MULTICAST_TTL) {
+ type = IPV6_MULTICAST_HOPS;
+ }
++ else if (type == IP_MULTICAST_LOOP) {
++ type = IPV6_MULTICAST_LOOP;
++ }
+ else {
+ return APR_ENOTIMPL;
+ }
+
+ if (setsockopt(sock->socketdes, IPPROTO_IPV6, type,
+- &value, sizeof(value)) == -1) {
++ (const void *) &value, sizeof(value)) == -1) {
+ rv = errno;
+ }
+ }
+Index: apr/network_io/unix/sendrecv.c
+===================================================================
+--- apr.orig/network_io/unix/sendrecv.c
++++ apr/network_io/unix/sendrecv.c
+@@ -245,7 +245,7 @@
+ /* Define a structure to pass in when we have a NULL header value */
+ static apr_hdtr_t no_hdtr;
+
+-#if defined(__linux__) && defined(HAVE_WRITEV)
++#if (defined(__linux__) || defined(__GNU__)) && defined(HAVE_WRITEV)
+
+ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
+ apr_hdtr_t *hdtr, apr_off_t *offset,
+Index: apr/network_io/unix/sockaddr.c
+===================================================================
+--- apr.orig/network_io/unix/sockaddr.c
++++ apr/network_io/unix/sockaddr.c
+@@ -356,9 +356,27 @@
+ }
+ error = getaddrinfo(hostname, servname, &hints, &ai_list);
+ #ifdef HAVE_GAI_ADDRCONFIG
+- if (error == EAI_BADFLAGS && family == APR_UNSPEC) {
+- /* Retry with no flags if AI_ADDRCONFIG was rejected. */
+- hints.ai_flags = 0;
++ /*
++ * Using AI_ADDRCONFIG involves some unfortunate guesswork because it
++ * does not consider loopback addresses when trying to determine if
++ * IPv4 or IPv6 is configured on a system (see RFC 3493).
++ * This is a problem if one actually wants to listen on or connect to
++ * the loopback address of a protocol family that is not otherwise
++ * configured on the system. See PR 52709.
++ * To work around some of the problems, retry without AI_ADDRCONFIG
++ * in case of EAI_ADDRFAMILY.
++ * XXX: apr_sockaddr_info_get() should really accept a flag to determine
++ * XXX: if AI_ADDRCONFIG's guesswork is wanted and if the address is
++ * XXX: to be used for listen() or connect().
++ *
++ * In case of EAI_BADFLAGS, AI_ADDRCONFIG is not supported.
++ */
++ if ((family == APR_UNSPEC) && (error == EAI_BADFLAGS
++#ifdef EAI_ADDRFAMILY
++ || error == EAI_ADDRFAMILY
++#endif
++ )) {
++ hints.ai_flags &= ~AI_ADDRCONFIG;
+ error = getaddrinfo(hostname, servname, &hints, &ai_list);
+ }
+ #endif
+Index: apr/include/apr_strings.h
+===================================================================
+--- apr.orig/include/apr_strings.h
++++ apr/include/apr_strings.h
+@@ -106,7 +106,11 @@
+ * has 'n' or more characters. If the string might contain
+ * fewer characters, use apr_pstrndup.
+ */
+-APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n);
++APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n)
++#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
++ __attribute__((alloc_size(3)))
++#endif
++ ;
+
+ /**
+ * Duplicate at most n characters of a string into memory allocated
+@@ -128,7 +132,11 @@
+ * @param n The number of bytes to duplicate
+ * @return The new block of memory
+ */
+-APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n);
++APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n)
++#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
++ __attribute__((alloc_size(3)))
++#endif
++ ;
+
+ /**
+ * Concatenate multiple strings, allocating memory out a pool
+Index: apr/include/apr_pools.h
+===================================================================
+--- apr.orig/include/apr_pools.h
++++ apr/include/apr_pools.h
+@@ -196,7 +196,8 @@
+ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool,
+ apr_pool_t *parent,
+ apr_abortfunc_t abort_fn,
+- apr_allocator_t *allocator);
++ apr_allocator_t *allocator)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Create a new pool.
+@@ -220,7 +221,8 @@
+ */
+ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool,
+ apr_abortfunc_t abort_fn,
+- apr_allocator_t *allocator);
++ apr_allocator_t *allocator)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Debug version of apr_pool_create_ex.
+@@ -242,7 +244,8 @@
+ apr_pool_t *parent,
+ apr_abortfunc_t abort_fn,
+ apr_allocator_t *allocator,
+- const char *file_line);
++ const char *file_line)
++ __attribute__((nonnull(1)));
+
+ #if APR_POOL_DEBUG
+ #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \
+@@ -277,7 +280,8 @@
+ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool,
+ apr_abortfunc_t abort_fn,
+ apr_allocator_t *allocator,
+- const char *file_line);
++ const char *file_line)
++ __attribute__((nonnull(1)));
+
+ #if APR_POOL_DEBUG
+ #define apr_pool_create_core_ex(newpool, abort_fn, allocator) \
+@@ -343,7 +347,8 @@
+ * Find the pool's allocator
+ * @param pool The pool to get the allocator from.
+ */
+-APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
++APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Clear all memory in the pool and run all the cleanups. This also destroys all
+@@ -353,7 +358,7 @@
+ * to re-use this memory for the next allocation.
+ * @see apr_pool_destroy()
+ */
+-APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
++APR_DECLARE(void) apr_pool_clear(apr_pool_t *p) __attribute__((nonnull(1)));
+
+ /**
+ * Debug version of apr_pool_clear.
+@@ -369,7 +374,8 @@
+ * and don't call apr_pool_destroy_clear directly.
+ */
+ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p,
+- const char *file_line);
++ const char *file_line)
++ __attribute__((nonnull(1)));
+
+ #if APR_POOL_DEBUG
+ #define apr_pool_clear(p) \
+@@ -382,7 +388,7 @@
+ * @param p The pool to destroy
+ * @remark This will actually free the memory
+ */
+-APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p);
++APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p) __attribute__((nonnull(1)));
+
+ /**
+ * Debug version of apr_pool_destroy.
+@@ -398,7 +404,8 @@
+ * and don't call apr_pool_destroy_debug directly.
+ */
+ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p,
+- const char *file_line);
++ const char *file_line)
++ __attribute__((nonnull(1)));
+
+ #if APR_POOL_DEBUG
+ #define apr_pool_destroy(p) \
+@@ -416,7 +423,11 @@
+ * @param size The amount of memory to allocate
+ * @return The allocated memory
+ */
+-APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size);
++APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size)
++#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
++ __attribute__((alloc_size(2)))
++#endif
++ __attribute__((nonnull(1)));
+
+ /**
+ * Debug version of apr_palloc
+@@ -427,7 +438,11 @@
+ * @return See: apr_palloc
+ */
+ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size,
+- const char *file_line);
++ const char *file_line)
++#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
++ __attribute__((alloc_size(2)))
++#endif
++ __attribute__((nonnull(1)));
+
+ #if APR_POOL_DEBUG
+ #define apr_palloc(p, size) \
+@@ -455,7 +470,8 @@
+ * @return See: apr_pcalloc
+ */
+ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size,
+- const char *file_line);
++ const char *file_line)
++ __attribute__((nonnull(1)));
+
+ #if APR_POOL_DEBUG
+ #define apr_pcalloc(p, size) \
+@@ -476,21 +492,24 @@
+ * deal with the error accordingly.
+ */
+ APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc,
+- apr_pool_t *pool);
++ apr_pool_t *pool)
++ __attribute__((nonnull(2)));
+
+ /**
+ * Get the abort function associated with the specified pool.
+ * @param pool The pool for retrieving the abort function.
+ * @return The abort function for the given pool.
+ */
+-APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool);
++APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Get the parent pool of the specified pool.
+ * @param pool The pool for retrieving the parent pool.
+ * @return The parent of the given pool.
+ */
+-APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool);
++APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Determine if pool a is an ancestor of pool b.
+@@ -510,7 +529,8 @@
+ * @param pool The pool to tag
+ * @param tag The tag
+ */
+-APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag);
++APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag)
++ __attribute__((nonnull(1)));
+
+
+ /*
+@@ -536,11 +556,11 @@
+ * key names is a typical way to help ensure this uniqueness.
+ *
+ */
+-APR_DECLARE(apr_status_t) apr_pool_userdata_set(
+- const void *data,
+- const char *key,
+- apr_status_t (*cleanup)(void *),
+- apr_pool_t *pool);
++APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data,
++ const char *key,
++ apr_status_t (*cleanup)(void *),
++ apr_pool_t *pool)
++ __attribute__((nonnull(2,4)));
+
+ /**
+ * Set the data associated with the current pool
+@@ -562,10 +582,10 @@
+ *
+ */
+ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(
+- const void *data,
+- const char *key,
+- apr_status_t (*cleanup)(void *),
+- apr_pool_t *pool);
++ const void *data, const char *key,
++ apr_status_t (*cleanup)(void *),
++ apr_pool_t *pool)
++ __attribute__((nonnull(2,4)));
+
+ /**
+ * Return the data associated with the current pool.
+@@ -574,7 +594,8 @@
+ * @param pool The current pool.
+ */
+ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key,
+- apr_pool_t *pool);
++ apr_pool_t *pool)
++ __attribute__((nonnull(1,2,3)));
+
+
+ /**
+@@ -601,10 +622,10 @@
+ * to exec - this function is called in the child, obviously!
+ */
+ APR_DECLARE(void) apr_pool_cleanup_register(
+- apr_pool_t *p,
+- const void *data,
+- apr_status_t (*plain_cleanup)(void *),
+- apr_status_t (*child_cleanup)(void *));
++ apr_pool_t *p, const void *data,
++ apr_status_t (*plain_cleanup)(void *),
++ apr_status_t (*child_cleanup)(void *))
++ __attribute__((nonnull(3,4)));
+
+ /**
+ * Register a function to be called when a pool is cleared or destroyed.
+@@ -619,9 +640,9 @@
+ * or destroyed
+ */
+ APR_DECLARE(void) apr_pool_pre_cleanup_register(
+- apr_pool_t *p,
+- const void *data,
+- apr_status_t (*plain_cleanup)(void *));
++ apr_pool_t *p, const void *data,
++ apr_status_t (*plain_cleanup)(void *))
++ __attribute__((nonnull(3)));
+
+ /**
+ * Remove a previously registered cleanup function.
+@@ -636,7 +657,8 @@
+ * function
+ */
+ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
+- apr_status_t (*cleanup)(void *));
++ apr_status_t (*cleanup)(void *))
++ __attribute__((nonnull(3)));
+
+ /**
+ * Replace the child cleanup function of a previously registered cleanup.
+@@ -651,10 +673,10 @@
+ * @param child_cleanup The function to register as the child cleanup
+ */
+ APR_DECLARE(void) apr_pool_child_cleanup_set(
+- apr_pool_t *p,
+- const void *data,
+- apr_status_t (*plain_cleanup)(void *),
+- apr_status_t (*child_cleanup)(void *));
++ apr_pool_t *p, const void *data,
++ apr_status_t (*plain_cleanup)(void *),
++ apr_status_t (*child_cleanup)(void *))
++ __attribute__((nonnull(3,4)));
+
+ /**
+ * Run the specified cleanup function immediately and unregister it.
+@@ -667,10 +689,9 @@
+ * @param data The data to remove from cleanup
+ * @param cleanup The function to remove from cleanup
+ */
+-APR_DECLARE(apr_status_t) apr_pool_cleanup_run(
+- apr_pool_t *p,
+- void *data,
+- apr_status_t (*cleanup)(void *));
++APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data,
++ apr_status_t (*cleanup)(void *))
++ __attribute__((nonnull(3)));
+
+ /**
+ * An empty cleanup function.
+@@ -739,7 +760,8 @@
+ * @param p The parent pool
+ * @param sub The subpool
+ */
+-APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub);
++APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub)
++ __attribute__((nonnull(2)));
+
+ /**
+ * Find a pool from something allocated in it.
+@@ -754,7 +776,8 @@
+ * @param recurse Recurse/include the subpools' sizes
+ * @return The number of bytes
+ */
+-APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse);
++APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Lock a pool
+Index: apr/include/apr.hw
+===================================================================
+--- apr.orig/include/apr.hw
++++ apr/include/apr.hw
+@@ -377,7 +377,7 @@
+ typedef int apr_socklen_t;
+ typedef apr_uint64_t apr_ino_t;
+
+-#ifdef WIN64
++#ifdef _WIN64
+ #define APR_SIZEOF_VOIDP 8
+ #else
+ #define APR_SIZEOF_VOIDP 4
+@@ -552,7 +552,7 @@
+ #define APR_DECLARE_DATA __declspec(dllimport)
+ #endif
+
+-#ifdef WIN64
++#ifdef _WIN64
+ #define APR_SSIZE_T_FMT "I64d"
+ #define APR_SIZE_T_FMT "I64u"
+ #else
+Index: apr/include/apr_allocator.h
+===================================================================
+--- apr.orig/include/apr_allocator.h
++++ apr/include/apr_allocator.h
+@@ -71,7 +71,8 @@
+ * @param allocator The allocator we have just created.
+ *
+ */
+-APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator);
++APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Destroy an allocator
+@@ -79,7 +80,8 @@
+ * @remark Any memnodes not given back to the allocator prior to destroying
+ * will _not_ be free()d.
+ */
+-APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator);
++APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Allocate a block of mem from the allocator
+@@ -88,7 +90,8 @@
+ * memnode structure)
+ */
+ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
+- apr_size_t size);
++ apr_size_t size)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Free a list of blocks of mem, giving them back to the allocator.
+@@ -98,7 +101,8 @@
+ * @param memnode The memory node to return
+ */
+ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
+- apr_memnode_t *memnode);
++ apr_memnode_t *memnode)
++ __attribute__((nonnull(1,2)));
+
+ #include "apr_pools.h"
+
+@@ -114,13 +118,15 @@
+ * the allocator will never be destroyed.
+ */
+ APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator,
+- apr_pool_t *pool);
++ apr_pool_t *pool)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Get the current owner of the allocator
+ * @param allocator The allocator to get the owner from
+ */
+-APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator);
++APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Set the current threshold at which the allocator should start
+@@ -129,7 +135,8 @@
+ * @param size The threshold. 0 == unlimited.
+ */
+ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
+- apr_size_t size);
++ apr_size_t size)
++ __attribute__((nonnull(1)));
+
+ #include "apr_thread_mutex.h"
+
+@@ -140,14 +147,16 @@
+ * @param mutex The mutex
+ */
+ APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator,
+- apr_thread_mutex_t *mutex);
++ apr_thread_mutex_t *mutex)
++ __attribute__((nonnull(1)));
+
+ /**
+ * Get the mutex currently set for the allocator
+ * @param allocator The allocator
+ */
+ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get(
+- apr_allocator_t *allocator);
++ apr_allocator_t *allocator)
++ __attribute__((nonnull(1)));
+
+ #endif /* APR_HAS_THREADS */
+
+Index: apr/build/mkdir.sh
+===================================================================
+--- apr.orig/build/mkdir.sh
++++ apr/build/mkdir.sh
+@@ -28,7 +28,13 @@
+ esac
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+- mkdir "$pathcomp" || errstatus=$?
++ thiserrstatus=0
++ mkdir "$pathcomp" || thiserrstatus=$?
++ # ignore errors due to races if a parallel mkdir.sh already
++ # created the dir
++ if test $thiserrstatus != 0 && test ! -d "$pathcomp" ; then
++ errstatus=$thiserrstatus
++ fi
+ fi
+ pathcomp="$pathcomp/"
+ done
+Index: apr/build/apr_hints.m4
+===================================================================
+--- apr.orig/build/apr_hints.m4
++++ apr/build/apr_hints.m4
+@@ -129,9 +129,6 @@
+ esac
+ APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
+ ;;
+- *-GNU*)
+- APR_ADDTO(CPPFLAGS, [-DHURD -D_GNU_SOURCE])
+- ;;
+ *-lynx-lynxos)
+ APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS])
+ APR_ADDTO(LIBS, [-lbsd])
+@@ -180,6 +177,9 @@
+ *-k*bsd*-gnu)
+ APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
+ ;;
++ *-gnu*|*-GNU*)
++ APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE -DHURD])
++ ;;
+ *-next-nextstep*)
+ APR_SETIFNULL(CFLAGS, [-O])
+ APR_ADDTO(CPPFLAGS, [-DNEXT])
+Index: apr/file_io/unix/seek.c
+===================================================================
+--- apr.orig/file_io/unix/seek.c
++++ apr/file_io/unix/seek.c
+@@ -117,10 +117,10 @@
+ /* Reset buffer positions for write mode */
+ fp->bufpos = fp->direction = fp->dataRead = 0;
+ }
++ file_unlock(fp);
+ if (rc) {
+ return rc;
+ }
+- file_unlock(fp);
+ }
+ if (ftruncate(fp->filedes, offset) == -1) {
+ return errno;
+Index: apr/shmem/win32/shm.c
+===================================================================
+--- apr.orig/shmem/win32/shm.c
++++ apr/shmem/win32/shm.c
+@@ -82,7 +82,7 @@
+ /* Compute the granualar multiple of the pagesize */
+ size = memblock * (1 + (reqsize - 1) / memblock);
+ sizelo = (DWORD)size;
+-#ifdef WIN64
++#ifdef _WIN64
+ sizehi = (DWORD)(size >> 32);
+ #else
+ sizehi = 0;
--
Debian packaging for the apr (Apache Portable Runtime) package
More information about the Pkg-apache-commits
mailing list