From patchwork Tue Sep 12 11:12:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Sojka X-Patchwork-Id: 812783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PapYRGS2"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xs2M45pJJz9s7g for ; Tue, 12 Sep 2017 21:17:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7qArR4OXxz/BmPD1R+IRIkDub5h22fe5i8F541EM4hg=; b=PapYRGS2MVXJV/ Fkx2iDQlwsASRwdhHXEBWSwpeAQxuJIFeb61qVsdtp/SpL8cv5hjVmvLujkEjVoy/JWPCStQsPGEo kko5lkHVEIurSMIdH73/WmXuB3mgOhE4mF8zKrRMQ5/bjNAnwIJT1PD25nvVn9RA6avaNof7qRk55 O2b41z3UeyRc3ODhnGRSYQ1oBVmikEBEudjHbAFgcAtK3t+t9J21T4pT9E3EOkxuaZM57vRCw5Ldj 7z6mXWd+iL1HpFns0m/Ve84r3wxh1YqwYaH48rbbhVQJeLbJPoWZm1SRUe9rRWuLgm6f0G1GkCNpq ftLlsDzPryGjEMpCQNJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1drjBq-0008Fd-F3; Tue, 12 Sep 2017 11:17:14 +0000 Received: from smtpx.feld.cvut.cz ([147.32.192.33]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1drj8n-0004ZP-Vb for lede-dev@lists.infradead.org; Tue, 12 Sep 2017 11:14:11 +0000 Received: from localhost (unknown [192.168.200.7]) by smtpx.feld.cvut.cz (Postfix) with ESMTP id 05FC1DC3E5; Tue, 12 Sep 2017 13:13:17 +0200 (CEST) X-Virus-Scanned: IMAP STYX AMAVIS Received: from smtpx.feld.cvut.cz ([192.168.200.6]) by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10054) with ESMTP id LJDRbzbBhGta; Tue, 12 Sep 2017 13:13:15 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by smtpx.feld.cvut.cz (Postfix) with ESMTP id 78584DC3EA; Tue, 12 Sep 2017 13:13:13 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.89) (envelope-from ) id 1drj7x-0008En-FH; Tue, 12 Sep 2017 13:13:13 +0200 From: Michal Sojka To: lede-dev@lists.infradead.org Date: Tue, 12 Sep 2017 13:12:46 +0200 Message-Id: <20170912111250.31576-17-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170912111250.31576-1-sojkam1@fel.cvut.cz> References: <20170912111250.31576-1-sojkam1@fel.cvut.cz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170912_041406_230339_D79EC8DD X-CRM114-Status: UNSURE ( 6.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [147.32.192.33 listed in list.dnswl.org] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH procd 14/17] utrace: Report ptrace errors X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Sojka MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org --- trace/trace.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trace/trace.c b/trace/trace.c index 6fbe608..eead9c5 100644 --- a/trace/trace.c +++ b/trace/trace.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifndef PTRACE_EVENT_STOP /* PTRACE_EVENT_STOP is defined in linux/ptrace.h, but this header @@ -351,8 +352,10 @@ int main(int argc, char **argv, char **envp) ptrace_restart = PTRACE_CONT; break; } - ptrace(PTRACE_SEIZE, child, 0, ptrace_options); - ptrace(ptrace_restart, child, 0, SIGCONT); + if (ptrace(PTRACE_SEIZE, child, 0, ptrace_options) == -1) + err(1, "PTRACE_SEIZE"); + if (ptrace(ptrace_restart, child, 0, SIGCONT) == -1) + err(1, "ptrace restart"); uloop_init(); tracer.proc.pid = child;