From patchwork Fri Jul 24 13:49:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 51448 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id ACACF20323 for ; Fri, 24 Jul 2015 13:49:49 +0000 (UTC) Received: by lafd3 with SMTP id d3sf7815215laf.1 for ; Fri, 24 Jul 2015 06:49:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=XMA5R5nmmP0VaX6Ify7NnVqlzPi1V3iPlnohcX6kQjE=; b=KhWnMluIF1DGydTrDX5UHripzwf+RTlAnJbHRfPPAzQeBcc0G0QMl6/+fjOzCyp3tr 4KlVzVsVbpyZxvJLLhKSjBO9udPTwvkgTbig83RDwloeRiSjstxJJFWoayj2GWfIVUpK k8+3v9JLobmzOq10d00nKz+oNuGVyXgjfvrnAgxnl1Ebco1wlnnWkKe0LHeJj3rBf8s9 2JlUNX//Ycs0RVdDXtUHR3KmjE8VP165KxFlPne0Cb1H7mhIX/NqL5+c5wW5JEDDloqE ySaWusrJ63qAFx+srqcACOHU5nF0pRsYDlGfboCDUdrsdm52idfCRcYO7xQq+E1gutur lo4w== X-Gm-Message-State: ALoCoQkp+AaKT4dVW/SUYNIk83ASnFFL2cuCpIbTH7zV5miC3eKwKfINlHjlRCNNSBfdgeGdieA5 X-Received: by 10.180.186.36 with SMTP id fh4mr1709252wic.7.1437745788634; Fri, 24 Jul 2015 06:49:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.1 with SMTP id h1ls362158lag.36.gmail; Fri, 24 Jul 2015 06:49:48 -0700 (PDT) X-Received: by 10.152.8.130 with SMTP id r2mr9695063laa.17.1437745788467; Fri, 24 Jul 2015 06:49:48 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id pr5si7574233lbb.140.2015.07.24.06.49.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 06:49:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagw2 with SMTP id w2so14488326lag.3 for ; Fri, 24 Jul 2015 06:49:48 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr14033569lbb.35.1437745788034; Fri, 24 Jul 2015 06:49:48 -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.7.198 with SMTP id l6csp2409lba; Fri, 24 Jul 2015 06:49:47 -0700 (PDT) X-Received: by 10.55.33.162 with SMTP id f34mr19819171qki.25.1437745786668; Fri, 24 Jul 2015 06:49:46 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i59si10107490qgi.49.2015.07.24.06.49.45; Fri, 24 Jul 2015 06:49:46 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id D66BE6181B; Fri, 24 Jul 2015 13:49:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8BFFB61B1D; Fri, 24 Jul 2015 13:49:42 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2C29661B1F; Fri, 24 Jul 2015 13:49:40 +0000 (UTC) Received: from mail-qg0-f50.google.com (mail-qg0-f50.google.com [209.85.192.50]) by lists.linaro.org (Postfix) with ESMTPS id 736B36183A for ; Fri, 24 Jul 2015 13:49:39 +0000 (UTC) Received: by qgii95 with SMTP id i95so10744143qgi.2 for ; Fri, 24 Jul 2015 06:49:39 -0700 (PDT) X-Received: by 10.140.27.211 with SMTP id 77mr20144417qgx.64.1437745779265; Fri, 24 Jul 2015 06:49:39 -0700 (PDT) Received: from localhost.localdomain (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by smtp.gmail.com with ESMTPSA id z135sm4039076qhd.29.2015.07.24.06.49.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jul 2015 06:49:38 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 24 Jul 2015 09:49:33 -0400 Message-Id: <1437745773-19713-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [PATCH] helper: linux: catch possible undefined X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.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.53 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 It is possible that wait will return a valid pid but have failed to have set a status. Set a default status so that if this occurs the value will be known and not garbage. Signed-off-by: Mike Holmes Reviewed-by: Bill Fischofer --- helper/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/linux.c b/helper/linux.c index 4256f43..3d3b6b8 100644 --- a/helper/linux.c +++ b/helper/linux.c @@ -198,7 +198,7 @@ int odph_linux_process_wait_n(odph_linux_process_t *proc_tbl, int num) { pid_t pid; int i, j; - int status; + int status = 0; for (i = 0; i < num; i++) { pid = wait(&status);