diff options
author | Jindrich Novy <jnovy@redhat.com> | 2011-03-04 04:43:32 +0100 |
---|---|---|
committer | Jindrich Novy <jnovy@redhat.com> | 2011-03-04 04:43:32 +0100 |
commit | 00274a017c43becb321fce3490fcc9b94ccee466 (patch) | |
tree | 9fbbe22a8f028a76f182ccf9c5ea261e8b245844 | |
parent | 183c8fa64c846c5d8ad8fe1671c8812059f35434 (diff) | |
download | librpm-tizen-00274a017c43becb321fce3490fcc9b94ccee466.tar.gz librpm-tizen-00274a017c43becb321fce3490fcc9b94ccee466.tar.bz2 librpm-tizen-00274a017c43becb321fce3490fcc9b94ccee466.zip |
Add missing exit status check for waitpid() while executing scriptlets
-rw-r--r-- | build/build.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/build/build.c b/build/build.c index 5924ec6b2..a5cdc991b 100644 --- a/build/build.c +++ b/build/build.c @@ -182,6 +182,13 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, pid = waitpid(child, &status, 0); + if (pid == -1) { + rpmlog(RPMLOG_ERR, _("Error executing scriptlet %s (%s)\n"), + scriptName, name); + rc = RPMRC_FAIL; + goto exit; + } + if (!WIFEXITED(status) || WEXITSTATUS(status)) { rpmlog(RPMLOG_ERR, _("Bad exit status from %s (%s)\n"), scriptName, name); |