From patchwork Mon Jul 4 15:44:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 71361 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1612036qgy; Mon, 4 Jul 2016 08:44:44 -0700 (PDT) X-Received: by 10.66.240.101 with SMTP id vz5mr23979559pac.16.1467647084415; Mon, 04 Jul 2016 08:44:44 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id dc8si4639760pad.280.2016.07.04.08.44.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2016 08:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-430965-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-430965-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-430965-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=lGNvrZycDDnzUM9gogePftsaS4662xsCTbXuuXaNSCGiwZ +/i6UR3BQGbomwD5IJWh7t3z55M0M5WMahqKOoAI8qHHHetemIyqYg4DOkg9OGYD fHraagu9cXQjmdoTGQox8pdOdme12quUvRQusncyh5UvMun6X7GzawIjIaDQU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=D0x/PzCManbPx1iXzeCXn3nJa1w=; b=Nwl3/Ty7sAqC7fTgIs0Y pTtoaafmhSijZb2NlsNhA1QvypAge1dQlYJjSQWT2Gw3BKhJRaK348vUZfBRQkeY 7wJB4yI4vmVEO3fPcT4Ln2L2wQIVxDehllvueHmQYc4NapoJI3Gxno+utgRb4VEb Om8JYDFAZ9dKMaxhNCIvafs= Received: (qmail 60710 invoked by alias); 4 Jul 2016 15:44:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 60696 invoked by uid 89); 4 Jul 2016 15:44:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Parent X-HELO: mail-qk0-f173.google.com Received: from mail-qk0-f173.google.com (HELO mail-qk0-f173.google.com) (209.85.220.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 04 Jul 2016 15:44:21 +0000 Received: by mail-qk0-f173.google.com with SMTP id t127so268552311qkf.1 for ; Mon, 04 Jul 2016 08:44:20 -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:from:date:message-id:subject:to; bh=K5q3NuzZNWoaOfD+TP5anKCXVR+SFfKsDerHg+cKCU4=; b=kVHoh03fGUMaDYKpGdyjIYdOJSfLNFjFfGpdDYhtGwdXW9YG8ff1K6B06mlKRXjhbb XUvQe9i4xraWh3yjRpy8UahmxM9zjt2Ftm9jVRz9KuVBB90RRGMfA+qx9jcayWcdTDyV 8e30sTRaN2rpQMlsC8VhLzrUI5MspJhFEje4Qb2t0th2bwi/7BfAtnSL8EjzbqoNMLVX W8y61aqlLRcj6/NZ7CKrEPrVSGRPp7YclKDQt9bvCROG/drjWx9xP/BjmGZv4A6RSfmM FrbW6f9MfnsJF8Soz1gUfoksf2vYnx+CJtIT2hxRbmdnSOsqTeT9evb8Pkv0qspPu3Z0 e4vw== X-Gm-Message-State: ALyK8tLv7roDvU+eO5DLtX0VOY4mzWfS0shYv9B7hO5kcCHDfyHD4qDAq3kkppvuo3B5Vrn/L/qlPa/VHb+JWqa8 X-Received: by 10.55.167.199 with SMTP id q190mr13692163qke.95.1467647058696; Mon, 04 Jul 2016 08:44:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.37.17 with HTTP; Mon, 4 Jul 2016 08:44:17 -0700 (PDT) From: Christophe Lyon Date: Mon, 4 Jul 2016 17:44:17 +0200 Message-ID: Subject: [testsuite] asan/clone-test-1.c: Handle clone() failure To: "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes Hello, This small patch handles the case were clone() would fail when executing asan/clone-test-1.c. OK? Christophe 2016-07-04 Christophe Lyon * c-c++-common/asan/clone-test-1.c (main): Handle clone() failure. diff --git a/gcc/testsuite/c-c++-common/asan/clone-test-1.c b/gcc/testsuite/c-c++-common/asan/clone-test-1.c index eeca09f..c58c376 100644 --- a/gcc/testsuite/c-c++-common/asan/clone-test-1.c +++ b/gcc/testsuite/c-c++-common/asan/clone-test-1.c @@ -29,6 +29,10 @@ int main(int argc, char **argv) { char *sp = child_stack + kStackSize; /* Stack grows down. */ printf("Parent: %p\n", sp); pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL, 0, 0, 0); + if (clone_pid == -1) { + perror("clone"); + return 1; + } int status; pid_t wait_result = waitpid(clone_pid, &status, __WCLONE); if (wait_result < 0) {