From 8aceebd817c77792eea840ec5585264e023b13f4 Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 29 Feb 2000 23:22:44 +0000 Subject: [PATCH] Portability fiddles. Rebuild with latest rpmmodule.so code. CVS patchset: 3600 CVS date: 2000/02/29 23:22:44 --- lib/rpmmalloc.c | 15 +++++++++++---- po/rpm.pot | 5 ++--- rpm.spec | 2 +- rpmio/rpmmalloc.c | 15 +++++++++++---- rpmrc.in | 4 ++-- scripts/freshen.sh | 5 ++++- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/lib/rpmmalloc.c b/lib/rpmmalloc.c index 0e713d7..94167b6 100644 --- a/lib/rpmmalloc.c +++ b/lib/rpmmalloc.c @@ -2,7 +2,7 @@ void *vmefail(void) { - fprintf(stderr, _("virtual memory exhausted.\n")); + fprintf(stderr, _("memory alloc returned NULL.\n")); exit(EXIT_FAILURE); /*@notreached@*/ return NULL; @@ -12,7 +12,9 @@ void *vmefail(void) void * xmalloc (size_t size) { - register void *value = malloc (size); + register void *value; + if (size == 0) size++; + value = malloc (size); if (value == 0) value = vmefail(); return value; @@ -20,7 +22,10 @@ void * xmalloc (size_t size) void * xcalloc (size_t nmemb, size_t size) { - register void *value = calloc (nmemb, size); + register void *value; + if (size == 0) size++; + if (nmemb == 0) nmemb++; + value = calloc (nmemb, size); if (value == 0) value = vmefail(); return value; @@ -28,7 +33,9 @@ void * xcalloc (size_t nmemb, size_t size) void * xrealloc (void *ptr, size_t size) { - register void *value = realloc (ptr, size); + register void *value; + if (size == 0) size++; + value = realloc (ptr, size); if (value == 0) value = vmefail(); return value; diff --git a/po/rpm.pot b/po/rpm.pot index efc1677..e96da2e 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-02-27 18:06-0500\n" +"POT-Creation-Date: 2000-02-29 18:19-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1235,8 +1235,7 @@ msgid "cannot re-open payload: %s\n" msgstr "" #: build/build.c:110 build/pack.c:312 -#, c-format -msgid "Unable to open temp file %s." +msgid "Unable to open temp file." msgstr "" #: build/build.c:189 diff --git a/rpm.spec b/rpm.spec index 2a2e2cf..ff56a09 100644 --- a/rpm.spec +++ b/rpm.spec @@ -2,7 +2,7 @@ Summary: The Red Hat package management system. Name: rpm %define version 3.0.4 Version: %{version} -Release: 0.45 +Release: 0.46 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz Copyright: GPL diff --git a/rpmio/rpmmalloc.c b/rpmio/rpmmalloc.c index 0e713d7..94167b6 100644 --- a/rpmio/rpmmalloc.c +++ b/rpmio/rpmmalloc.c @@ -2,7 +2,7 @@ void *vmefail(void) { - fprintf(stderr, _("virtual memory exhausted.\n")); + fprintf(stderr, _("memory alloc returned NULL.\n")); exit(EXIT_FAILURE); /*@notreached@*/ return NULL; @@ -12,7 +12,9 @@ void *vmefail(void) void * xmalloc (size_t size) { - register void *value = malloc (size); + register void *value; + if (size == 0) size++; + value = malloc (size); if (value == 0) value = vmefail(); return value; @@ -20,7 +22,10 @@ void * xmalloc (size_t size) void * xcalloc (size_t nmemb, size_t size) { - register void *value = calloc (nmemb, size); + register void *value; + if (size == 0) size++; + if (nmemb == 0) nmemb++; + value = calloc (nmemb, size); if (value == 0) value = vmefail(); return value; @@ -28,7 +33,9 @@ void * xcalloc (size_t nmemb, size_t size) void * xrealloc (void *ptr, size_t size) { - register void *value = realloc (ptr, size); + register void *value; + if (size == 0) size++; + value = realloc (ptr, size); if (value == 0) value = vmefail(); return value; diff --git a/rpmrc.in b/rpmrc.in index 77bf1cd..5f78ae5 100644 --- a/rpmrc.in +++ b/rpmrc.in @@ -1,4 +1,4 @@ -# $Id: rpmrc.in,v 2.17 2000/02/25 16:29:44 jbj Exp $ +# $Id: rpmrc.in,v 2.18 2000/02/29 23:22:44 jbj Exp $ ############################################################# @@ -214,7 +214,7 @@ os_compat: hpux10.00: hpux9.07 os_compat: hpux9.07: hpux9.05 os_compat: hpux9.05: hpux9.04 -os_compat: osf4.0: osf3.2 +os_compat: osf4.0: osf3.2 osf1 os_compat: ncr-sysv4.3: ncr-sysv4.2 diff --git a/scripts/freshen.sh b/scripts/freshen.sh index 31e3ecd..fd1f848 100755 --- a/scripts/freshen.sh +++ b/scripts/freshen.sh @@ -37,7 +37,10 @@ for n in $*; do if [ ! -f $n ]; then args="$args $n" else - if ! rpm -q `rpm -qp $n` >/dev/null 2>&1; then + if rpm -q `rpm -qp $n` >/dev/null 2>&1 + then + ; + else name=`rpm --qf "%{NAME}" -qp $n` $RPM -q $name >/dev/null 2>&1 && args="$args $n" fi -- 2.7.4