From patchwork Fri Jun 22 21:57:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Strachan X-Patchwork-Id: 934128 X-Patchwork-Delegate: petr.vorel@gmail.com 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=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="O5lTP6c+"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DjH82c3yz9s2t for ; Mon, 25 Jun 2018 18:37:53 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B3A083E74B1 for ; Mon, 25 Jun 2018 10:37:46 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id 3CE143E608A for ; Fri, 22 Jun 2018 23:57:15 +0200 (CEST) Received: from mail-yw0-x24a.google.com (mail-yw0-x24a.google.com [IPv6:2607:f8b0:4002:c05::24a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 2204A10009C0 for ; Fri, 22 Jun 2018 23:57:14 +0200 (CEST) Received: by mail-yw0-x24a.google.com with SMTP id t78-v6so5236457ywg.20 for ; Fri, 22 Jun 2018 14:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:message-id:subject:from:to:cc; bh=zp2tzcob/EELLK9EyOXR0fHxG6rVLr+yRgTVxvDpZ1I=; b=O5lTP6c+1Onjrb7TKbqy/4JRCEYImksdRJ4oe1PNoQqbXYX4/ArGGFRotZ08BmWeZf EkBCAQRo3YvdgjTPNrLqd+8RdM6bjGc/HoX+QyO9ZS03VfMnzk8ZVXvnX9HAmLf7Lo2S 1ZNBrRth8sTXIsBAbMK8hNwmrAPy8MtJlrL/MLSVQ9xBRzTTsxzPOP1/RXHEkbVXkWfA NUTZa7HVXVvaHItgjzSP5nkFfAPuUCIcx5SG0tZinqiChKd42W/RZh8wKhyO9pepEi2f N16P3Rb36E97poPeoOfAXGXhYnkNIpJNxnESeVyg57fTOtzNhD/4HOPRPhXTohpE33Ii hT2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=zp2tzcob/EELLK9EyOXR0fHxG6rVLr+yRgTVxvDpZ1I=; b=M0C48g5Tqdw8B28ZxpsenuWVeFKnMI9Ignl84askZ5J+2sGNwx7r2bwIzi4Fm74R+f BsND/7DxFXHJ7y8x73Kb9Lt3wNcE5OTWOQSTUpx22KS/n47kZ5NDWqUW3jVqaz6owMjM qHiMtG40vFOBmRmg6APCHhzxU43bB08TcokG+S388ZO7lP9rYk1LpuvuT61A/ZrFh2uO vKqggOiIjS2aW37/14/cqdOig7QQc03eBaHMQtt611LDnsJe8a9Ptw6B8VSZz01+u8es V8Qvk3XJ7M1lYu5Q/5lQ0sp648klVoWmjFh/meE+VC476N0oHUdGwrLIqkgobZVWvbi1 PSzQ== X-Gm-Message-State: APt69E19lJIX0L1fvRbZ8/WN05QJOuGIc19PacNLWMPKZK2vGkFfED1N v4doN8AjLIQF24921PCVW/rr878T7vtnGm/twzh5KwKoXG/JOxSKcqgLMQsMgHZA8ILps8daKvH Qv1oOGQLI4NJ2+prG2Ysc+Us/+DCee8R4rrlQnH1o4SacRk7zM7HVxZuQByFtxx21 X-Google-Smtp-Source: ADUXVKLPQrLGR7auhE19R1hIvGPPG60UB3SBkbNFZiFzM37arKwteItX8lKwLi7vvGZ8HQzm9u/tHncnHtmdA6I= MIME-Version: 1.0 X-Received: by 2002:a81:218b:: with SMTP id h133-v6mr940437ywh.42.1529704632768; Fri, 22 Jun 2018 14:57:12 -0700 (PDT) Date: Fri, 22 Jun 2018 14:57:07 -0700 Message-Id: <20180622215710.126661-1-astrachan@google.com> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog From: Alistair Strachan To: ltp@lists.linux.it X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-7.4 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it X-Mailman-Approved-At: Mon, 25 Jun 2018 10:37:44 +0200 Cc: kernel-team@android.com Subject: [LTP] [PATCH] pathconf01: Use TMPDIR instead of "/tmp" if set X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Enable this test to work in environments without a /tmp directory. Signed-off-by: Alistair Strachan --- testcases/kernel/syscalls/pathconf/pathconf01.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/pathconf/pathconf01.c b/testcases/kernel/syscalls/pathconf/pathconf01.c index ddbe87f7a..362bae94f 100644 --- a/testcases/kernel/syscalls/pathconf/pathconf01.c +++ b/testcases/kernel/syscalls/pathconf/pathconf01.c @@ -154,7 +154,8 @@ int main(int ac, char **av) tst_parse_opts(ac, av, options, &help); if (!lflag) { - path = strdup("/tmp"); + tst_tmpdir(); + path = tst_get_tmpdir(); } /*************************************************************** * perform global setup for test @@ -221,7 +222,10 @@ void setup(void) ***************************************************************/ void cleanup(void) { - + if (!lflag) { + tst_rmdir(); + free(path); + } } /***************************************************************