- Log failures for fork failing (OLPC)

- Gendiff enhancement from Enrico Scholz (#146981)
This commit is contained in:
Paul Nasrat 2007-04-16 11:59:52 +00:00
parent eb6953f551
commit e266478320
3 changed files with 71 additions and 1 deletions

22
rpm-4.4.2-cdiff.patch Normal file
View File

@ -0,0 +1,22 @@
--- rpm-4.4.2/gendiff.cdiff 2002-07-13 20:54:36.000000000 +0100
+++ rpm-4.4.2/gendiff 2007-04-16 12:48:09.000000000 +0100
@@ -6,14 +6,16 @@
exit 1
}
+: ${DIFF:=diff -p}
+
find $1 \( -name "*$2" -o -name ".*$2" \) -print |
while read f; do
U=-u
[ "`basename $f`" = "ChangeLog$2" ] && U=-U0
-# diff ${U} $f `echo $f | sed s/$2\$//`
+# ${DIFF} ${U} $f `echo $f | sed s/$2\$//`
if [ -r "$f" ]; then
- diff ${U} "${f}" "${f%$2}"
+ ${DIFF} ${U} "${f}" "${f%$2}"
else
- diff ${U} /dev/null "${f%$2}"
+ ${DIFF} ${U} /dev/null "${f%$2}"
fi
done

View File

@ -0,0 +1,40 @@
Print error message if scriptlet fork fails instead if silently
dying. [#152779]
Index: lib/psm.c
===================================================================
--- lib/psm.c.orig
+++ lib/psm.c
@@ -910,6 +910,12 @@ static rpmRC runScript(rpmpsm psm, Heade
}
/*@=branchstate@*/
+ if (psm->sq.child == (pid_t)-1) {
+ rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
+ rc = RPMRC_FAIL;
+ goto exit;
+ }
+
(void) psmWait(psm);
/* XXX filter order dependent multilib "other" arch helper error. */
@@ -934,6 +940,7 @@ static rpmRC runScript(rpmpsm psm, Heade
}
}
+exit:
if (freePrefixes) prefixes = hfd(prefixes, ipt);
xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */
Index: rpmio/rpmsq.c
===================================================================
--- rpmio/rpmsq.c.orig
+++ rpmio/rpmsq.c
@@ -407,6 +407,7 @@ fprintf(stderr, " Enable(%p): %p\n",
pid = fork();
if (pid < (pid_t) 0) { /* fork failed. */
+ sq->child = (pid_t)-1;
/*@-bounds@*/
xx = close(sq->pipes[0]);
xx = close(sq->pipes[1]);

View File

@ -17,7 +17,7 @@ Summary: The RPM package management system
Name: rpm
Version: 4.4.2
%{expand: %%define rpm_version %{version}}
Release: 42%{?dist}
Release: 43%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source: rpm-%{rpm_version}.tar.gz
@ -63,6 +63,8 @@ Patch36: rpm-4.4.2-unicodekey.patch
Patch37: rpm-4.4.2-noneon.patch
Patch38: rpm-4.4.2-debugedit-canonicalize-path.patch
Patch39: rpm-4.4.2-no-ppc-asm.patch
Patch40: rpm-4.4.2-forkfailed.patch
Patch41: rpm-4.4.2-cdiff.patch
License: GPL
Requires: patch > 2.5
Prereq: shadow-utils
@ -204,6 +206,8 @@ shell-like rules.
%patch37 -p1 -b .noneon
%patch38 -p0 -b .debugcan
%patch39 -p1 -b .noppcasm
%patch40 -p0 -b .forkfail
%patch41 -p1 -b .cdiff
# rebuild configure for ipv6
autoconf
@ -562,6 +566,10 @@ exit 0
%{__includedir}/popt.h
%changelog
* Mon Apr 16 2007 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-43
- Log failures for fork failing (OLPC)
- Gendiff enhancement from Enrico Scholz (#146981)
* Wed Apr 04 2007 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-42
- Remove ppc64 inline asm (#233145)