From patchwork Wed Sep 27 12:56:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 819142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-85025-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ou5QZoVw"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y2Hrq4QGyz9tXQ for ; Wed, 27 Sep 2017 22:56:43 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type; q=dns; s=default; b=PwlA1xbH2mjv+PP1f7yZl AjX/lLWePnidJrRxfsBU7FXZqPDg0ByuiSUJ2eegj+Id5wXN4yEUY7UFq88WCFJQ FvQ7aGPitEXxkCwzvDLcEuFmBs5mUfaxNrG7tJL6I7ZX9rDiE7pyYGz8Au7CNCBd 0B8PMzD0oSKxc2CKkpplhw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type; s=default; bh=kL9xLvYjyeyIr31zLLmBRFFhK7I =; b=ou5QZoVwHW2ublakQW6bfpCeeLkNDeHMBROMgjNf2pCAJMftH5Zfqcyogko x7wKTuqi7w5HibSh6dq8RnY2IUB1c4jgDrGN/+9OqnG6RbfSTcmpeVcXNGCe1Xe5 OzDYXP2/s89nJa5JrNmlttywK65DRWCzB/0L7ay0vXMqmyKY= Received: (qmail 52042 invoked by alias); 27 Sep 2017 12:56:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 52023 invoked by uid 89); 27 Sep 2017 12:56:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1712, incorrectly X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Message-ID: <59CB9FFA.20307@arm.com> Date: Wed, 27 Sep 2017 13:56:26 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH] fix posix/tst-spawn test X-ClientProxiedBy: VI1PR0602CA0013.eurprd06.prod.outlook.com (2603:10a6:800:bc::23) To AM5PR0802MB2483.eurprd08.prod.outlook.com (2603:10a6:203:9b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e845cef-2448-4b12-5231-08d505a72c95 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:AM5PR0802MB2483; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2483; 3:6t1iGJT9Y2LTs2iyW2kcfvnjzWP+booGNTWv3o7/+H41yzreoQzQYMaE4RIRdDjqPzeLh3xt9MEMS+1uBJLR1OMAah8yjJgO0AFaqu76EhGjR/QqJ2FFeJKhbZcTFz9NtRHkIAmH6mnwC+Rf58sVLy0deRmVFvdGudPua3muLrTo+K3zk6yBS2+U/Oev8rF+E2JcUEBTS8WpgP9kPC6IqL4EgOAy+drbXvf9tSVLfVXW6zijhEPYshWxlX8z8IbP; 25:nkw3xiwUTviWP1NQKYWZpB1xlBg30/nwOiw/rM9Rttv2poFqAXyPjITyEMmyvXJFIsPjsTNXSGfGtuWieyU+nTsfjrF6f76K6Kxnsbr+roxuZJIZtxRFphdWvgfgixQ3eSn43hseFAn5LyKbXP/OxWyhJswyqPAPKlyGVOm8kMQvotEqXWwrYv85X4OoS6URYkBdHRZBQl12J8zVqseNBubDu/ONPR+wCYB/1Z7VNJsOYwrx58SvmeDy8tU2hpLLEe/pG5qmbjyqr4rFISyf1e8Os7BzRVcgdLkgQKCMzUOEvlDSWe6vycRggeK7zyinJpzTttryiRekGM7Y1PpEVg==; 31:XmxdD9c1/KT+kaTMMuQJqRXu5atLGxbxccHxeV4dSi970bkVV6cySXN7iyv86MRW7ZMiiZ1vL2ZqfAL3j7CAmaKE5MqBAP9U/mnuwTdGnWhnQ4Dk7g2l9zDtqfcgLzw/qNINKSgutcK4dAJADMHhWEIXaa0+SS2ivrXZZw2TOeA9YyX+eO3bBk4LnLRknxkxDIFR8KUhbrzktfRTAgv3BcY4E6dmE2lWDqqleriI4Co= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2483: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2483; 20:imODPqaqipqgwNIRAWoGjh488Aym2qcwIa3thRB8YUZef7WdhvQu9ZQ8KbJ2s3R5F2HO4HZ9azf/bQKvolipsJU3ghyRwJoILIS3LqVWIP5gus5i3IHhXiu1rmEfxwHvz/tTCabCMH0s/bDNu0Mi0K1ZbpPki6scSBS6dOn/7CE=; 4:dJyjuc+Jh0qNG0KbLakgXebH6OxoDY6lx7MSu7m1ouv+NI/sOkeNGpHzcjVcw+6aQPY5a0rAv6beybW5F80sj4F8jnlBJbvATsHJzs+p8shR11W2FL2Hs/bo/SqdO+klbpE9NFzJEhV/3pvGpTa5zfe1O9KCC+oXhjsqXpqUIH7kuPK3S7nkWOPIRtBDSqn9ltwnuuH3rVaUsnqimhdkALTpO8dlvaUoJCxqBaSRKLZrqFd/+LZJkfwrcfDZtyGFMl0EreGXVfwNTC3jKYws3jGv9/AW53FMgN2gKBmDGiw= X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2483; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2483; X-Forefront-PRVS: 04433051BF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(346002)(39860400002)(376002)(199003)(377424004)(189002)(65816999)(16586007)(72206003)(305945005)(54356999)(50986999)(2476003)(2906002)(7736002)(65806001)(4326008)(66066001)(83506001)(65956001)(101416001)(68736007)(64126003)(568964002)(33656002)(270700001)(6116002)(3846002)(84326002)(5660300001)(25786009)(81156014)(81166006)(36756003)(8676002)(189998001)(97736004)(77096006)(6486002)(53936002)(6666003)(8936002)(58126008)(86362001)(16526017)(16576012)(4610100001)(478600001)(6916009)(564344004)(5890100001)(5000100001)(105586002)(316002)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2483; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2483; 23:9+mh/aTDmWBNLJfVHChG5K2pCtnQyZvtyvi9vMbGyqP8NjEPt7uVvri06xOSGiIQZxApwl2SZuNc/v7UPZe/WJRXT2Iw88nB8ViEtkAAMOWQzMqvPn5Q1p4yBh94IuGK6sGmYvzx/AEuGx8VtQHeYt6UNEEauBSuBIKpHCryh70oOoLhy8w8ChDtK6Z1soFLEaicXrY5g6rv3I2NxNt4ihu1tk6zHPPlM7aG628at0eMJHbE68TeQTJ/9zFI30UkB6mLFuVceTbSNSqpU1ckfO4QQvf9eInKJGy2quSM39JFJJ2SwX9AEzwhlAEnr7g6YwfAGk/4Sl2XYc3s9jsL/hmsHojWmkb8p4FDV4aTIgx3xr+/IlwMlY/B/nPYrObvOILxxNtk4FZGCd3QAs0AJGbmGgLjm+pIH88Kc1eIPnhLT3SXYQMiDaY3UUE3QWSDArnzqEXT0+C6soYEeREGyWFAzxKyTI+MIsUQ0JDaAPVCm9bXfqe9ebMzTThYn/EJcyg1cK42rqcdDxDjXqjPtr04HO5+KL/oHM6eXpdJvTv7j6NsjJmy+BgH7uXUf9KVEoF53R1S1VAABzlYPyv+AtvLfj/5XnmKFiMK+X3OxFYl8Cdogucs/qHgK7ggFKLV2vyx7NdPa74Ja6e4bre8pEwhjaHw0m2B5MFiXRx8oN6xii5iCTJG+pS2ZHwM7SJksY+4+Y9h9aXhZJo9LkVkckaGNuQff/ti09upS9UoMDCTzv12yoruUwRIeUUh8Y3pZXDftIqZzSngpxhvqVztjOYPv0wWkBP00TxE13aRn1ldHWgPEGTEXLh7RsDKGXKBugk41bJSVhTu7x+XmM1u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sj1OcS/n6PIfHun13XJJSaHZ34FgTZOLQv04oAQEDvfIm1Yu3P96yMQ=; 7:Vdriv3ASZaWq0fGc3RGhjzMmUDH2C9o+e0A1GHmaE9jvHBtsTYuLPD+CVeTUxraBDTbNiRuxMXt8+ufh8rNWEqcdnUCnlIaVtygJwniFLuIZy2i9byrgmNfWDzVPBZXuTz7nyGfQkZemTzBTTlqQ6jka9GP3ornk3HI9RmtkJLWabZUi05YTW+H9R2wpkmszrH9CUuz8HxTXZvN/BYGoiiEy27oUAKpi4Nnr8JCV+VM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2017 12:56:30.5172 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2483 The test spawns two children but only waited for one. 2017-09-27 Szabolcs Nagy * posix/tst-spawn.c (do_test): Wait for both children. diff --git a/posix/tst-spawn.c b/posix/tst-spawn.c index 08d92bd7a7afdaf1a1abf2f996b00bb107c1d631..c224e6a563327234b134214c98e6123ed99adbc8 100644 --- a/posix/tst-spawn.c +++ b/posix/tst-spawn.c @@ -240,22 +240,30 @@ do_test (int argc, char *argv[]) if (posix_spawn (&pid, argv[1], &actions, NULL, spargv, environ) != 0) error (EXIT_FAILURE, errno, "posix_spawn"); + /* Wait for the child. */ + if (waitpid (pid, &status, 0) != pid) + error (EXIT_FAILURE, errno, "wrong child"); + if (WTERMSIG (status) != 0) + error (EXIT_FAILURE, 0, "Child terminated incorrectly"); + if (WEXITSTATUS (status) != 0) + error (EXIT_FAILURE, 0, "Child failed"); + /* Same test but with a NULL pid argument. */ if (posix_spawn (NULL, argv[1], &actions, NULL, spargv, environ) != 0) error (EXIT_FAILURE, errno, "posix_spawn"); + /* Wait for the child. */ + if (waitpid (-1, &status, 0) == -1) + error (EXIT_FAILURE, errno, "waitpid failed"); + if (WTERMSIG (status) != 0) + error (EXIT_FAILURE, 0, "Child terminated incorrectly"); + if (WEXITSTATUS (status) != 0) + error (EXIT_FAILURE, 0, "Child failed"); + /* Cleanup. */ if (posix_spawn_file_actions_destroy (&actions) != 0) error (EXIT_FAILURE, errno, "posix_spawn_file_actions_destroy"); free (name3_copy); - /* Wait for the child. */ - if (waitpid (pid, &status, 0) != pid) - error (EXIT_FAILURE, errno, "wrong child"); - - if (WTERMSIG (status) != 0) - error (EXIT_FAILURE, 0, "Child terminated incorrectly"); - status = WEXITSTATUS (status); - - return status; + return 0; }