From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.kundenserver.de ([212.227.126.187]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XOpBJ-0006Xf-Rc for ptxdist@pengutronix.de; Tue, 02 Sep 2014 16:35:39 +0200 From: Tim Niemeyer Date: Tue, 2 Sep 2014 16:35:12 +0200 Message-Id: <1409668513-21018-2-git-send-email-tim.niemeyer@corscience.de> In-Reply-To: <1409668513-21018-1-git-send-email-tim.niemeyer@corscience.de> References: <1409668513-21018-1-git-send-email-tim.niemeyer@corscience.de> Subject: [ptxdist] [PATCH] ptxd_make_xpkg_pkg: handle SIGPIPE correctly Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.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 --- 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