Message ID | 1414591597-2763-14-git-send-email-acme@kernel.org |
---|---|
State | Accepted |
Commit | ed3077585f2f041e0db0fc41060b69673e98963b |
Headers | show
Return-Path: <patchwork-forward+bncBDZ7JWMQ2EGBBWHJYORAKGQE4CJKARY@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB0DC24046 for <linaro@patches.linaro.org>; Wed, 29 Oct 2014 14:08:25 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf1739880lab.5 for <linaro@patches.linaro.org>; Wed, 29 Oct 2014 07:08:24 -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=Kn4gNZp2sYRJnjyY3rTLbu2e5q3QaN9XuqHKH6oNdAE=; b=NPcGBawVLwc0Zyl0MO5MRakC2jcqAE31xASoeRWl9esXD4lJGIJhAYdQGsS7uf7p96 u1FIAUAoSRDC1A2W0A7EmknBm2VEh0p8PBxSiJNXgM2RF73aWWQdnj9XgbVc/gsiZ6vw oVl0nunBAyZZYcpFBjEsbDm6Q3EjvylABobDu++L5HqlaWAkaREMp9ZggR1wBkfQdjbn IclSjPhMsVxDLhjs58ckr5Dm68IRjXQ0ET+4kmPC2Js/dkUc6RXh4fsgEFvPB65+Ec17 2oTiz5tA+IHLlXDHmVK2Un0/SMBgQKuJemI8udptRWceT8qYM44N/2Ivu1YuuqZf9Qv1 J4JA== X-Gm-Message-State: ALoCoQlOjXIZTlwdXen69ozbb6OcM6686Zn1mF1F4RA6LxoUEGE8EksVtCxVy+ug/6JVdm3er3Zb X-Received: by 10.194.178.163 with SMTP id cz3mr1816945wjc.1.1414591704619; Wed, 29 Oct 2014 07:08:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.227 with SMTP id i3ls167184lae.28.gmail; Wed, 29 Oct 2014 07:08:24 -0700 (PDT) X-Received: by 10.112.199.40 with SMTP id jh8mr5541656lbc.5.1414591704371; Wed, 29 Oct 2014 07:08:24 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id r3si7308340lar.133.2014.10.29.07.08.24 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Oct 2014 07:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id 10so2457048lbg.8 for <patchwork-forward@linaro.org>; Wed, 29 Oct 2014 07:08:24 -0700 (PDT) X-Received: by 10.112.14.69 with SMTP id n5mr11652399lbc.34.1414591704269; Wed, 29 Oct 2014 07:08:24 -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 c5csp663914lbz; Wed, 29 Oct 2014 07:08:23 -0700 (PDT) X-Received: by 10.70.130.47 with SMTP id ob15mr10909792pdb.112.1414591700049; Wed, 29 Oct 2014 07:08:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id km1si4168681pbd.22.2014.10.29.07.08.19 for <multiple recipients>; Wed, 29 Oct 2014 07:08:19 -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 S933637AbaJ2OIG (ORCPT <rfc822;hongbo.zhang@linaro.org> + 26 others); Wed, 29 Oct 2014 10:08:06 -0400 Received: from mail.kernel.org ([198.145.19.201]:41281 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933594AbaJ2OIA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 29 Oct 2014 10:08:00 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E01122024C; Wed, 29 Oct 2014 14:07:58 +0000 (UTC) Received: from zoo.ghostprotocols.net.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 995892022A; Wed, 29 Oct 2014 14:07:54 +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 13/25] perf tools: Ensure return negative value when write header error Date: Wed, 29 Oct 2014 12:06:25 -0200 Message-Id: <1414591597-2763-14-git-send-email-acme@kernel.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1414591597-2763-1-git-send-email-acme@kernel.org> References: <1414591597-2763-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.217.177 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 26f5b2fe5dc8..0ecf4a304cbc 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -601,8 +601,10 @@ static int __write_cpudesc(int fd, const char *cpuinfo_proc) break; } - if (ret) + if (ret) { + ret = -1; goto done; + } s = buf; @@ -965,7 +967,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;