Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-08-20 22:00:10 -0400
committerAllan McRae <allan@archlinux.org>2013-09-04 09:51:19 +1000
commit3a2a752e1eb1b9a57d62e6982461456c9693d34c (patch)
tree99dd4ff35829b7f5bfd9aa1a68a34be73bb4b3dd /lib
parentce7456b4ccbe3ca7b06c9b50fe59ce7367172c4f (diff)
alpm: log errors for scriptlets terminated by a signal
Fixes FS#36618. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index f1f760a5..19a8612f 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -599,6 +599,15 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[])
_alpm_log(handle, ALPM_LOG_ERROR, _("command failed to execute correctly\n"));
retval = 1;
}
+ } else if(WIFSIGNALED(status) != 0) {
+ char *signal_description = strsignal(WTERMSIG(status));
+ /* strsignal can return NULL on some (non-Linux) platforms */
+ if(signal_description == NULL) {
+ signal_description = _("Unknown signal");
+ }
+ _alpm_log(handle, ALPM_LOG_ERROR, _("command terminated by signal %d: %s\n"),
+ WTERMSIG(status), signal_description);
+ retval = 1;
}
}