From 69d291b8029fad5b1ec9924936901db6ec054d9d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 20 Jun 2009 15:07:36 +0000 Subject: [PATCH] - Pull in upstream patch to check waitpid return values (testing as possible fix for RHBZ#507066). --- guestfs-daemon-waitpid.patch | 26 ++++++++++++++++++++++++++ libguestfs.spec | 9 +++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 guestfs-daemon-waitpid.patch diff --git a/guestfs-daemon-waitpid.patch b/guestfs-daemon-waitpid.patch new file mode 100644 index 0000000..5ea9e7e --- /dev/null +++ b/guestfs-daemon-waitpid.patch @@ -0,0 +1,26 @@ +diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c +index 2e83b9f..030aabe 100644 +--- a/daemon/guestfsd.c ++++ b/daemon/guestfsd.c +@@ -453,7 +453,8 @@ commandrv (char **stdoutput, char **stderror, char * const* const argv) + { + int so_size = 0, se_size = 0; + int so_fd[2], se_fd[2]; +- int pid, r, quit, i; ++ pid_t pid; ++ int r, quit, i; + fd_set rset, rset2; + char buf[256]; + char *p; +@@ -589,7 +590,10 @@ commandrv (char **stdoutput, char **stderror, char * const* const argv) + } + + /* Get the exit status of the command. */ +- waitpid (pid, &r, 0); ++ if (waitpid (pid, &r, 0) != pid) { ++ perror ("waitpid"); ++ return -1; ++ } + + if (WIFEXITED (r)) { + return WEXITSTATUS (r); diff --git a/libguestfs.spec b/libguestfs.spec index 81ad228..839a996 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -4,7 +4,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Version: 1.0.49 -Release: 4%{?dist} +Release: 5%{?dist} License: LGPLv2+ Group: Development/Libraries URL: http://libguestfs.org/ @@ -13,6 +13,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root # Upstream: 3c5b447efd42b03c24104bdc1f3260e879bb1d25 Patch0: guestfs-daemon-find.patch +# Upstream: 6654f617a6f720baa8f1ced89179e11679353d1e +Patch1: guestfs-daemon-waitpid.patch # Basic build requirements: BuildRequires: /usr/bin/pod2man @@ -253,6 +255,7 @@ Requires: jpackage-utils %setup -q %patch0 -p1 +%patch1 -p1 mkdir -p daemon/m4 @@ -498,10 +501,12 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Sat Jun 20 2009 Richard W.M. Jones - 1.0.49-4 +* Sat Jun 20 2009 Richard W.M. Jones - 1.0.49-5 - Remove workaround for RHBZ#507007, since bug is now fixed. - Pull in upstream patch to fix pclose checking (testing as possible fix for RHBZ#507066). +- Pull in upstream patch to check waitpid return values + (testing as possible fix for RHBZ#507066). * Fri Jun 19 2009 Richard W.M. Jones - 1.0.49-2 - New upstream release 1.0.49.