Message ID | 1414503146-22789-15-git-send-email-acme@kernel.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <patchwork-forward+bncBDZ7JWMQ2EGBBVFWX2RAKGQEPPOMPFQ@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8003424026 for <linaro@patches.linaro.org>; Tue, 28 Oct 2014 13:34:13 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id d17sf705167eek.3 for <linaro@patches.linaro.org>; Tue, 28 Oct 2014 06:34:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=+6UZoomR9CpI1IfSgaElxzOMnamvJIyggYzT80gY1yw=; b=m4LmhVfRGKCHjFOM5n8oNc2HHVx12z1eElWYNsnmIYVGmYAIoXgShZk81lHu785dqE wiEddVvCXEQlW4EE87cfnd4Qj1XmoBuwmeCxIh1tOkpBjVgFHtPBgb6jxooAvDciS+SU 1Hz21F/S1th0xpOAAgJINIygNRGWR/jL+hAtp8RW/OhxQhHEu/MDmY4sPBj0I4v2CKvT mzZNYCLWe3M3QsEgaEebYxawxj8v8oEGt6F+AHOpCwvmwnwRnvAYxDPOpyYg+LoQmSqn D/rd7RJ/p0iK3Y02csrD/gEEc/k2Zs2HAf4/nr3rDmcRRK6el8alwMwAHqUmoQzXXZAC VaHA== X-Gm-Message-State: ALoCoQkWdfYVEGsZYbspZbvLvsqmLYnUAgFXgOmKzN13FpOfMOqryY+h8Ulw6xAjJd+pebtmk4Nc X-Received: by 10.180.93.35 with SMTP id cr3mr763064wib.2.1414503252698; Tue, 28 Oct 2014 06:34:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.226 with SMTP id z2ls64644lad.13.gmail; Tue, 28 Oct 2014 06:34:12 -0700 (PDT) X-Received: by 10.112.201.138 with SMTP id ka10mr4178800lbc.20.1414503252378; Tue, 28 Oct 2014 06:34:12 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id e3si2626138lam.28.2014.10.28.06.34.12 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 06:34:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id hs14so614805lab.19 for <patchwork-forward@linaro.org>; Tue, 28 Oct 2014 06:34:12 -0700 (PDT) X-Received: by 10.112.14.69 with SMTP id n5mr4127424lbc.34.1414503252263; Tue, 28 Oct 2014 06:34:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp481022lbz; Tue, 28 Oct 2014 06:34:11 -0700 (PDT) X-Received: by 10.70.92.68 with SMTP id ck4mr3760892pdb.28.1414503240927; Tue, 28 Oct 2014 06:34:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id py4si1329994pbb.157.2014.10.28.06.34.00 for <multiple recipients>; Tue, 28 Oct 2014 06:34:00 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754534AbaJ1Ndt (ORCPT <rfc822;hongbo.zhang@linaro.org> + 26 others); Tue, 28 Oct 2014 09:33:49 -0400 Received: from mail.kernel.org ([198.145.19.201]:51375 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754463AbaJ1Ndo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Oct 2014 09:33:44 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 980192024F; Tue, 28 Oct 2014 13:33:43 +0000 (UTC) Received: from zoo.home (unknown [191.250.127.60]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DD7A2024D; Tue, 28 Oct 2014 13:33:39 +0000 (UTC) From: Arnaldo Carvalho de Melo <acme@kernel.org> To: Ingo Molnar <mingo@kernel.org> Cc: linux-kernel@vger.kernel.org, Wang Nan <wangnan0@huawei.com>, Adrian Hunter <adrian.hunter@intel.com>, Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>, Li Zefan <lizefan@huawei.com>, Namhyung Kim <namhyung.kim@lge.com>, Paul Mackerras <paulus@samba.org>, Peter Zijlstra <a.p.zijlstra@chello.nl>, Waiman Long <Waiman.Long@hp.com>, Arnaldo Carvalho de Melo <acme@redhat.com> Subject: [PATCH 14/32] perf tools: Ensure return negative value when write header error Date: Tue, 28 Oct 2014 11:32:08 -0200 Message-Id: <1414503146-22789-15-git-send-email-acme@kernel.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1414503146-22789-1-git-send-email-acme@kernel.org> References: <1414503146-22789-1-git-send-email-acme@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: <patchwork-forward.linaro.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: acme@kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index ce0de00399da..39b80ac9f698 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -605,8 +605,10 @@ static int write_cpudesc(int fd, struct perf_header *h __maybe_unused, break; } - if (ret) + if (ret) { + ret = -1; goto done; + } s = buf; @@ -950,7 +952,8 @@ static int write_total_mem(int fd, struct perf_header *h __maybe_unused, n = sscanf(buf, "%*s %"PRIu64, &mem); if (n == 1) ret = do_write(fd, &mem, sizeof(mem)); - } + } else + ret = -1; free(buf); fclose(fp); return ret;