--- rpm.new/rpmio/rpmio.h Wed Jun 23 21:27:17 2004 +++ rpm/rpmio/rpmio.h Tue Jun 29 01:11:27 2004 @@ -10,7 +10,7 @@ #include #include /*@-noparams@*/ -#include +//#include /*@=noparams@*/ #include #include diff -Nru rpm-4.1.1.orig/misc/glob.h rpm-4.1.1/misc/glob.h --- rpm-4.1.1.orig/misc/glob.h 2000-03-11 21:59:30 +0100 +++ rpm-4.1.1/misc/glob.h 2004-06-12 18:48:55 +0200 @@ -46,7 +46,7 @@ #endif /* C++ or ANSI C. */ /* We need `size_t' for the following definitions. */ -#ifndef __size_t +#if !defined(__size_t) && !defined(_SIZE_T_DECLARED) # if defined __GNUC__ && __GNUC__ >= 2 typedef __SIZE_TYPE__ __size_t; # ifdef _XOPEN_SOURCE --- rpm.new/rpmio/fts.c Wed Jun 23 21:27:17 2004 +++ rpm/rpmio/fts.c Tue Jun 29 01:43:28 2004 @@ -34,6 +34,8 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #endif /* LIBC_SCCS and not lint */ +#undef _LIBC + #if defined(_LIBC) #include #include @@ -45,14 +47,13 @@ #include #include #else -#if defined(hpux) # define _INCLUDE_POSIX_SOURCE # define __errno_location() (&errno) # define dirfd(dirp) -1 # define stat64 stat # define _STAT_VER 0 # define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) -#endif + #if defined(sun) # define __errno_location() (&errno) # define dirfd(dirp) -1 --- rpm.bef/rpmio/rpmrpc.c Wed Jun 23 21:27:01 2004 +++ rpm/rpmio/rpmrpc.c Tue Jun 29 01:51:05 2004 @@ -1087,6 +1087,9 @@ #endif }; +#undef DT_DIR +#define sun + #if !defined(DT_DIR) # define DT_UNKNOWN 0 # define DT_FIFO 1 --- rpm.bef/rpmio/rpmsq.h Wed Jun 23 21:27:01 2004 +++ rpm/rpmio/rpmsq.h Tue Jun 29 03:19:55 2004 @@ -7,6 +7,7 @@ */ #include +#include /** */ --- rpm.bef/python/rpmfd-py.c Wed Jun 23 21:27:01 2004 +++ rpm/python/rpmfd-py.c Tue Jun 29 03:25:00 2004 @@ -4,7 +4,6 @@ #include "system.h" -#include /* XXX rpmio.h */ #include /* XXX rpmio.h */ #include --- rpm.bef/rpmio/Makefile.am Wed Jun 23 21:27:01 2004 +++ rpm/rpmio/Makefile.am Tue Jun 29 14:10:39 2004 @@ -37,8 +37,7 @@ @WITH_BEECRYPT_LIB@ \ $(top_builddir)/file/src/libfmagic.la \ $(top_builddir)/lua/liblua.la \ - @WITH_ZLIB_LIB@ \ - -lrt -lpthread + @WITH_ZLIB_LIB@ -lintl librpmio_la_LIBADD = # $(BEECRYPTLOBJS) librpmio_la_DEPENDENCIES = # .created --- rpm.bef/lua/Makefile.am Tue Jun 29 14:55:47 2004 +++ rpm/lua/Makefile.am Tue Jun 29 14:51:19 2004 @@ -21,7 +21,7 @@ luac_luac_CFLAGS = -DLUA_OPNAMES liblua_la_CFLAGS = -DUSE_DLOPEN -DWITH_POSIX -liblua_la_LIBADD = -lm -ldl +liblua_la_LIBADD = -lm liblua_la_SOURCES = \ local/linit.c \ local/linit.lch \ --- rpm.bef/configure.ac Wed Jun 23 21:27:13 2004 +++ rpm/configure.ac Tue Jun 29 14:58:04 2004 @@ -551,7 +551,6 @@ AC_CHECK_HEADERS(sys/mman.h sys/resource.h sys/utsname.h sys/wait.h) AC_CHECK_HEADERS(netinet/in_systm.h) -AC_CHECK_HEADERS(machine/types.h) AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h) AC_CHECK_HEADERS(sys/mount.h sys/mntctl.h sys/param.h sys/vmount.h) AC_CHECK_HEADERS(bzlib.h libio.h zlib.h) --- rpm.bef/rpmio/fts.h Wed Jun 23 21:27:01 2004 +++ rpm/rpmio/fts.h Tue Jun 29 22:07:21 2004 @@ -45,11 +45,7 @@ # define __END_DECLS #endif -#if defined(hpux) # define _D_EXACT_NAMLEN(d) ((d)->d_namlen) -# define _INCLUDE_POSIX_SOURCE -# define _LARGEFILE64_SOURCE -#endif #if defined(sun) # define _D_EXACT_NAMLEN(d) ((d)->d_reclen) --- rpm.bef/rpmio/rpmsq.c Wed Jun 23 21:27:01 2004 +++ rpm/rpmio/rpmsq.c Tue Jun 29 23:17:26 2004 @@ -126,9 +130,10 @@ #include + /*@unchecked@*/ /*@-type@*/ -static pthread_mutex_t rpmsigTbl_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +static pthread_mutex_t rpmsigTbl_lock; //= PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; /*@=type@*/ #define DO_LOCK() pthread_mutex_lock(&rpmsigTbl_lock); @@ -190,14 +195,14 @@ { rpmsq sq = (rpmsq) elem; int ret = -1; + int old_sigmask; if (sq != NULL) { #ifdef _RPMSQ_DEBUG if (_rpmsq_debug) fprintf(stderr, " Insert(%p): %p\n", ME(), sq); #endif - ret = sighold(SIGCHLD); - if (ret == 0) { + old_sigmask = sigblock(SIGCHLD); sq->child = 0; sq->reaped = 0; sq->status = 0; @@ -210,16 +215,16 @@ ret = pthread_mutex_init(&sq->mutex, NULL); ret = pthread_cond_init(&sq->cond, NULL); insque(elem, (prev != NULL ? prev : rpmsqQueue)); - ret = sigrelse(SIGCHLD); - } + sigsetmask(old_sigmask); } - return ret; + return 0; } int rpmsqRemove(void * elem) { rpmsq sq = (rpmsq) elem; int ret = -1; + int old_sigmask; if (elem != NULL) { @@ -227,8 +232,7 @@ if (_rpmsq_debug) fprintf(stderr, " Remove(%p): %p\n", ME(), sq); #endif - ret = sighold (SIGCHLD); - if (ret == 0) { + old_sigmask = sigblock(SIGCHLD); remque(elem); ret = pthread_cond_destroy(&sq->cond); ret = pthread_mutex_destroy(&sq->mutex); @@ -244,10 +248,9 @@ sq->reaped = 0; sq->child = 0; #endif - ret = sigrelse(SIGCHLD); - } + sigsetmask(old_sigmask); } - return ret; + return 0; } /*@unchecked@*/ @@ -373,6 +376,7 @@ { pid_t pid; int xx; + int old_sigmask; if (sq->reaper) { xx = rpmsqInsert(sq, NULL); @@ -385,7 +389,7 @@ xx = pipe(sq->pipes); - xx = sighold(SIGCHLD); + old_sigmask = sigblock(SIGCHLD); pid = fork(); if (pid < (pid_t) 0) { /* fork failed. */ @@ -423,7 +427,7 @@ } out: - xx = sigrelse(SIGCHLD); + sigsetmask(old_sigmask); return sq->child; } @@ -440,9 +444,10 @@ int nothreads = 0; int ret = 0; int xx; + int old_sigmask; /* Protect sq->reaped from handler changes. */ - ret = sighold(SIGCHLD); + old_sigmask = sigblock(SIGCHLD); /* Initialize the cond var mutex. */ if (!nothreads) @@ -467,9 +472,9 @@ /* Note that sigpause re-enables SIGCHLD. */ ret = sigpause(SIGCHLD); else { - xx = sigrelse(SIGCHLD); + sigsetmask(old_sigmask); ret = pthread_cond_wait(&sq->cond, &sq->mutex); - xx = sighold(SIGCHLD); + old_sigmask = sigblock(SIGCHLD); } } /*@=infloops@*/ @@ -480,7 +485,7 @@ /* Tear down cond var mutex, our child has been reaped. */ if (!nothreads) xx = pthread_mutex_unlock(&sq->mutex); - xx = sigrelse(SIGCHLD); + sigsetmask(old_sigmask); #ifdef _RPMSQ_DEBUG if (_rpmsq_debug) --- rpm.bef/lib/rpmsx.c Wed Jun 23 21:27:11 2004 +++ rpm/lib/rpmsx.c Tue Jun 29 23:22:48 2004 @@ -156,7 +156,8 @@ } sxs = sx->sxs + sx->nsxs; sxs->len = stem_len; -/*@i@*/ sxs->stem = strndup(*bpp, stem_len); +/*@i@*/ sxs->stem = malloc(stem_len); + strncpy(sxs->stem, *bpp, stem_len); sx->nsxs++; *bpp += stem_len; return sx->nsxs - 1; --- rpm.bef/lib/Makefile.am Wed Jun 23 21:27:11 2004 +++ rpm/lib/Makefile.am Wed Jun 30 00:21:49 2004 @@ -40,7 +40,7 @@ librpm_la_LDFLAGS = -release 4.3 $(LDFLAGS) \ $(top_builddir)/rpmdb/librpmdb.la \ $(top_builddir)/rpmio/librpmio.la \ - -lpopt \ + -lpopt -lintl \ @WITH_SELINUX_LIB@ getdate.c: getdate.y --- rpm.bef/tools/Makefile.am Wed Jun 23 21:27:02 2004 +++ rpm/tools/Makefile.am Wed Jun 30 00:20:24 2004 @@ -29,7 +29,7 @@ noinst_PROGRAMS = rpmtool rpmxml dumpdb pkgbindir = @RPMCONFIGDIR@ -pkgbin_PROGRAMS = debugedit javadeps rpmcache rpmdeps rpmfile +pkgbin_PROGRAMS = javadeps rpmcache rpmdeps rpmfile bin_PROGRAMS = rpmgraph @@ -72,4 +72,4 @@ rpmxml_SOURCES = rpmxml.c rpmxp.c rpmxml_LDADD = -lxml2 -$(PROGRAMS): $(LDADD) +$(PROGRAMS): --- rpm/configure.ac.orig Sun Jul 4 16:24:28 2004 +++ rpm/configure.ac Sun Jul 4 16:26:48 2004 @@ -505,6 +505,10 @@ echo "Building for AmigaOS: using vfork() instead of fork()"; CFLAGS="$CFLAGS -Dfork=vfork" ;; + *freebsd* ) + echo "Turning on pthread support on FreeBSD"; + CFLAGS="$CFLAGS -pthread" + ;; esac if test -z "${WITH_ZLIB_LIB}" ; then