commit:     de40ef688f60ccfaffaaf17bd250825d6372c9bc
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 21 18:00:18 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Feb 21 18:00:18 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=de40ef68

xsystembash: output error messages ourselves

---
 libq/xsystem.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libq/xsystem.c b/libq/xsystem.c
index e688c5d..199a1d2 100644
--- a/libq/xsystem.c
+++ b/libq/xsystem.c
@@ -27,11 +27,14 @@ static void xsystembash(const char *command)
 
        default: /* parent */
                waitpid(p, &status, 0);
-               if (WIFEXITED(status)) {
+               if (WIFSIGNALED(status)) {
+                       err("phase crashed with signal %i: %s", 
WTERMSIG(status),
+                           strsignal(WTERMSIG(status)));
+               } else if (WIFEXITED(status)) {
                        if (WEXITSTATUS(status) == 0)
                                return;
                        else
-                               exit(WEXITSTATUS(status));
+                               err("phase exited %i", WEXITSTATUS(status));
                }
                /* fall through */
 

Reply via email to