mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Tim Niemeyer <tim.niemeyer@corscience.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] ptxd_make_xpkg_pkg: handle SIGPIPE correctly
Date: Tue,  2 Sep 2014 16:35:12 +0200	[thread overview]
Message-ID: <1409668513-21018-2-git-send-email-tim.niemeyer@corscience.de> (raw)
In-Reply-To: <1409668513-21018-1-git-send-email-tim.niemeyer@corscience.de>

grep -q exits as soon as the first expression is found. This leads to a
SIGPIPE to the objcopy process. SIGPIPE results in an exit code of 141.
So ptxd_install_file_extract_debug must handle the 141 return value as
,,didn't work'' because the grep found the expected error string.

Signed-off-by: Tim Niemeyer <tim.niemeyer@corscience.de>
---

 scripts/lib/ptxd_make_xpkg_pkg.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index c80adea..86196a2 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -230,7 +230,7 @@ ptxd_install_file_extract_debug() {
     "${CROSS_OBJCOPY}" ${ptxd_install_file_objcopy_args} "${dir}${dst}" "${dbg}" |&
 	grep -q "\(unrecognized option\|unable to initialize commpress status\)"
     local -a status=( "${PIPESTATUS[@]}" )
-    if [ ${status[0]} -eq 1 ]; then
+    if [ ${status[0]} -ne 0 ]; then
 	if [ ${status[1]} -eq 0 ]; then
 	    ptxd_install_file_objcopy_args="--only-keep-debug"
 	    "${CROSS_OBJCOPY}" ${ptxd_install_file_objcopy_args} "${dir}${dst}" "${dbg}"
-- 
1.7.10.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2014-09-02 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 14:35 [ptxdist] [PATCH 0/1] " Tim Niemeyer
2014-09-02 14:35 ` Tim Niemeyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409668513-21018-2-git-send-email-tim.niemeyer@corscience.de \
    --to=tim.niemeyer@corscience.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox