- update to 1.2.2

This commit is contained in:
jorton 2005-12-02 09:05:07 +00:00
parent 37089a6ce0
commit dd63283c03
4 changed files with 98 additions and 106 deletions

View File

@ -1,6 +1,30 @@
--- apr-0.9.6/file_io/unix/dir.c.readdir64
+++ apr-0.9.6/file_io/unix/dir.c
@@ -77,24 +77,24 @@
--- apr-1.2.2/include/arch/unix/apr_arch_file_io.h.readdir64
+++ apr-1.2.2/include/arch/unix/apr_arch_file_io.h
@@ -121,11 +124,21 @@
typedef struct stat struct_stat;
#endif
+/* readdir64_r is only used in specific cases: */
+#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
+ && !defined(READDIR_IS_THREAD_SAFE) && defined(HAVE_READDIR64_R)
+#define APR_USE_READDIR64_R
+#endif
+
struct apr_dir_t {
apr_pool_t *pool;
char *dirname;
DIR *dirstruct;
+#ifdef APR_USE_READDIR64_R
+ struct dirent64 *entry;
+#else
struct dirent *entry;
+#endif
};
apr_status_t apr_unix_file_cleanup(void *);
--- apr-1.2.2/file_io/unix/dir.c.readdir64
+++ apr-1.2.2/file_io/unix/dir.c
@@ -77,8 +77,8 @@
* one-byte array. Note: gcc evaluates this at compile time.
*/
apr_size_t dirent_size =
@ -8,39 +32,14 @@
- sizeof(struct dirent) : sizeof (struct dirent) + 255);
+ sizeof(*(*new)->entry) +
+ (sizeof((*new)->entry->d_name) > 1 ? 0 : 255);
+ DIR *dir = opendir(dirname);
+
+ if (!dir) {
+ return errno;
+ }
DIR *dir = opendir(dirname);
(*new) = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t));
(*new)->pool = pool;
(*new)->dirname = apr_pstrdup(pool, dirname);
- (*new)->dirstruct = opendir(dirname);
+ (*new)->dirstruct = dir;
(*new)->entry = apr_pcalloc(pool, dirent_size);
- if ((*new)->dirstruct == NULL) {
- return errno;
- }
- else {
- apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup,
- apr_pool_cleanup_null);
- return APR_SUCCESS;
- }
+ apr_pool_cleanup_register((*new)->pool, *new, dir_cleanup,
+ apr_pool_cleanup_null);
+ return APR_SUCCESS;
}
apr_status_t apr_dir_close(apr_dir_t *thedir)
@@ -139,9 +139,28 @@
if (!dir) {
@@ -139,15 +139,34 @@
#endif
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
&& !defined(READDIR_IS_THREAD_SAFE)
+#ifdef HAVE_READDIR64_R
+#ifdef APR_USE_READDIR64_R
+ struct dirent64 *retent;
+
+ /* If LFS is enabled and readdir64_r is available, readdir64_r is
@ -63,13 +62,23 @@
ret = readdir_r(thedir->dirstruct, thedir->entry, &retent);
+#endif
/* Avoid the Linux problem where at end-of-directory thedir->entry
* is set to NULL, but ret = APR_SUCCESS.
@@ -191,9 +210,22 @@
- /* Avoid the Linux problem where at end-of-directory thedir->entry
- * is set to NULL, but ret = APR_SUCCESS.
- */
- if(!ret && thedir->entry != retent)
+ /* POSIX treats "end of directory" as a non-error case, so ret
+ * will be zero and retent will be set to NULL in that case. */
+ if (!ret && retent == NULL) {
ret = APR_ENOENT;
+ }
/* Solaris is a bit strange, if there are no more entries in the
* directory, it returns EINVAL. Since this is against POSIX, we
@@ -191,21 +210,38 @@
#endif
#ifdef DIRENT_INODE
if (thedir->entry->DIRENT_INODE && thedir->entry->DIRENT_INODE != -1) {
+#ifdef HAVE_READDIR64_R
+#ifdef APR_USE_READDIR64_R
+ /* If readdir64_r is used, check for the overflow case of trying
+ * to fit a 64-bit integer into a 32-bit integer. */
+ if (sizeof(apr_ino_t) >= sizeof(retent->DIRENT_INODE)
@ -82,15 +91,37 @@
+ }
+#else
wanted &= ~APR_FINFO_INODE;
+#endif /* HAVE_READDIR64_R */
+#endif /* APR_USE_READDIR64_R */
}
-#endif
+#endif /* DIRENT_INODE */
wanted &= ~APR_FINFO_NAME;
--- apr-0.9.6/file_io/unix/filestat.c.readdir64
+++ apr-0.9.6/file_io/unix/filestat.c
if (wanted)
{
char fspec[APR_PATH_MAX];
- int off;
- apr_cpystrn(fspec, thedir->dirname, sizeof(fspec));
- off = strlen(fspec);
- if ((fspec[off - 1] != '/') && (off + 1 < sizeof(fspec)))
- fspec[off++] = '/';
- apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off);
+ char *end;
+
+ end = apr_cpystrn(fspec, thedir->dirname, sizeof fspec);
+
+ if (end > fspec && end[-1] != '/' && (end < fspec + APR_PATH_MAX))
+ *end++ = '/';
+
+ apr_cpystrn(end, thedir->entry->d_name,
+ sizeof fspec - (end - fspec));
+
ret = apr_stat(finfo, fspec, APR_FINFO_LINK | wanted, thedir->pool);
/* We passed a stack name that will disappear */
finfo->fname = NULL;
--- apr-1.2.2/file_io/unix/filestat.c.readdir64
+++ apr-1.2.2/file_io/unix/filestat.c
@@ -77,9 +77,18 @@
finfo->user = info->st_uid;
finfo->group = info->st_gid;
@ -111,25 +142,11 @@
apr_time_ansi_put(&finfo->atime, info->st_atime);
apr_time_ansi_put(&finfo->mtime, info->st_mtime);
apr_time_ansi_put(&finfo->ctime, info->st_ctime);
--- apr-0.9.6/include/arch/unix/apr_arch_file_io.h.readdir64
+++ apr-0.9.6/include/arch/unix/apr_arch_file_io.h
@@ -108,7 +108,11 @@
apr_pool_t *pool;
char *dirname;
DIR *dirstruct;
+#ifdef HAVE_READDIR64_R
+ struct dirent64 *entry;
+#else
struct dirent *entry;
+#endif
};
apr_status_t apr_unix_file_cleanup(void *);
--- apr-0.9.6/configure.in.readdir64
+++ apr-0.9.6/configure.in
@@ -1310,6 +1310,10 @@
--- apr-1.2.2/configure.in.readdir64
+++ apr-1.2.2/configure.in
@@ -1382,6 +1382,10 @@
AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0")
AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0")
AC_CHECK_FUNC($int64_strfn, have_int64_strfn="1", have_int64_strfn="0")
+if test "$ac_cv_sizeof_long" = "4"; then
+ AC_CHECK_FUNCS([readdir64_r])

View File

@ -1,23 +1,17 @@
%define aprver 0
%define aprver 1
Summary: Apache Portable Runtime library
Name: apr
Version: 0.9.7
Release: 4
Version: 1.2.2
Release: 1
License: Apache Software License
Group: System Environment/Libraries
URL: http://apr.apache.org/
Source0: %{name}-%{version}.tar.gz
Patch3: apr-0.9.3-noipv6.patch
Patch4: apr-0.9.4-trimlibs.patch
Patch6: apr-0.9.4-tests.patch
Patch10: apr-0.9.4-cflags.patch
Patch18: apr-0.9.4-stacksize.patch
Patch21: apr-0.9.4-lp64psem.patch
Patch23: apr-0.9.6-readdir64.patch
Patch26: apr-0.9.6-tcpopts.patch
Patch27: apr-0.9.6-procexit.patch
Patch28: apr-0.9.7-deepbind.patch
Patch1: apr-0.9.6-readdir64.patch
Patch2: apr-0.9.6-procexit.patch
Patch3: apr-0.9.7-deepbind.patch
Patch4: apr-1.2.2-chdirwarn.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildPrereq: autoconf, libtool, doxygen
Conflicts: subversion < 0.20.1-2
@ -43,23 +37,17 @@ C data structures and routines.
%prep
%setup -q
%patch3 -p1 -b .noipv6
%patch4 -p1 -b .trimlibs
%patch6 -p1 -b .tests
%patch10 -p1 -b .cflags
%patch18 -p1 -b .stacksize
%patch21 -p1 -b .lp64psem
%patch23 -p1 -b .readdir64
%patch26 -p1 -b .tcpopts
%patch27 -p1 -b .procexit
%patch28 -p1 -b .deepbind
%patch1 -p1 -b .readdir64
%patch2 -p1 -b .procexit
%patch3 -p1 -b .deepbind
%patch4 -p1 -b .chdirwarn
%build
# regenerate configure script etc.
./buildconf
%configure \
--includedir=%{_includedir}/apr-%{aprver} \
--with-installbuilddir=%{_libdir}/apr/build \
--with-installbuilddir=%{_libdir}/apr-%{aprver}/build \
--with-devrandom=/dev/urandom \
CC=gcc CXX=g++
make %{?_smp_mflags} && make dox
@ -67,31 +55,14 @@ make %{?_smp_mflags} && make dox
%check
# Run non-interactive tests
pushd test
make %{?_smp_mflags} testall CFLAGS=-fno-strict-aliasing
TZ=PST8PDT ./testall -v || exit 1
make %{?_smp_mflags} testall
./testall -v -q || exit 1
popd
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# These are referenced by apr_rules.mk
for f in make_exports.awk make_var_export.awk; do
install -m 644 build/${f} $RPM_BUILD_ROOT%{_libdir}/apr/build/${f}
done
install -m 755 build/mkdir.sh $RPM_BUILD_ROOT%{_libdir}/apr/build/mkdir.sh
# fix apr-config to point at the install "srcdir" (fixed properly in 1.0.0)
sed -i -e "s,^\(APR_.*_DIR\)=.*$,\1=%{_libdir}/apr," \
$RPM_BUILD_ROOT%{_bindir}/apr-config
# Sanitize apr_rules.mk
sed -e "/^apr_build/d" \
-e 's|$(apr_builders)|%{_libdir}/apr/build|g' \
-e 's|$(apr_builddir)|%{_libdir}/apr/build|g' \
< build/apr_rules.mk > $RPM_BUILD_ROOT%{_libdir}/apr/build/apr_rules.mk
# Move docs to more convenient location
mv docs/dox/html html
@ -115,16 +86,20 @@ rm -rf $RPM_BUILD_ROOT
%doc docs/APRDesign.html docs/canonical_filenames.html
%doc docs/incomplete_types docs/non_apr_programs
%doc --parents html
%{_bindir}/apr-config
%{_bindir}/apr-%{aprver}-config
%{_libdir}/libapr-%{aprver}.*a
%{_libdir}/libapr-%{aprver}.so
%dir %{_libdir}/apr
%dir %{_libdir}/apr/build
%{_libdir}/apr/build/*
%{_libdir}/pkgconfig/*.pc
%dir %{_libdir}/apr-%{aprver}
%dir %{_libdir}/apr-%{aprver}/build
%{_libdir}/apr-%{aprver}/build/*
%dir %{_includedir}/apr-%{aprver}
%{_includedir}/apr-%{aprver}/*.h
%changelog
* Fri Dec 2 2005 Joe Orton <jorton@redhat.com> 1.2.2-1
- update to 1.2.2
* Wed Nov 30 2005 Warren Togami <wtogami@redhat.com> 0.9.7-4
- rebuild against gcc-4.1.0

View File

@ -1 +1 @@
061772cac0d8acf8e3ee402eb57944c9 apr-0.9.7.tar.gz
f96e3b04ccf86ed28a0734d7efc5bb65 apr-1.2.2.tar.gz

View File

@ -1 +1 @@
apr-0.9.7.tar.gz
apr-1.2.2.tar.gz