From patchwork Wed Oct 26 11:29:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 79398 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp9099qge; Wed, 26 Oct 2016 04:29:58 -0700 (PDT) X-Received: by 10.99.99.195 with SMTP id x186mr2811893pgb.100.1477481398082; Wed, 26 Oct 2016 04:29:58 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 136si2086357pga.241.2016.10.26.04.29.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 04:29:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-439583-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-439583-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-439583-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=eeA3j/r9AUv7Y6XIngWn8G1p2jmb5vwOMBxPjxOp5PS07tsfc9iBN WwAGdCNVV4X+Y504zerG+d7QZ1X32nzQeeI9txVe4SdQTUAv2Bz/lUjvkZMln3rO pzVVl8CN1/AtKN2OjR5xJtz97U+KgcaZ1nw7olWe8Nntf864AKmYKA= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=TclnSWHsWUrqfoZT0GVn/qbnSIM=; b=PgKQauJzVAye797+qpN9 Sn1mBiAW60aoYAorY6YvrTdYETuVVEq+70RMDvJZeVubyx6CbUHRcEAJpt7YSb4g r/gdD8d54sFt+/6v/eSZCteMoZzuYCCbd6/i/OokE/Kntb6xeBs6oVV84fGZaxKX OENj11MZAVPska3NWg2MU2w= Received: (qmail 37015 invoked by alias); 26 Oct 2016 11:29:43 -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 36927 invoked by uid 89); 26 Oct 2016 11:29:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=uros, Filesystem, dnl, U*ubizjak X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 11:29:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4423F4E4EE; Wed, 26 Oct 2016 11:29:31 +0000 (UTC) Received: from localhost (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QBTU5W032161; Wed, 26 Oct 2016 07:29:30 -0400 Date: Wed, 26 Oct 2016 12:29:30 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++/78111 fix fallback code for filesystem::canonical Message-ID: <20161026112930.GT2922@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.0 (2016-08-17) The configure test for realpath() is missing a header, and the fallback version of filesystem::canonical() that gets used if realpath() fails was not setting an error. Tested powerpc64le-linux, committed to trunk. commit f36dd7f817590c618884e14433dd70c03334c288 Author: Jonathan Wakely Date: Wed Oct 26 12:16:18 2016 +0100 PR78111 fix fallback code for filesystem::canonical PR libstdc++/78111 * src/filesystem/ops.cc (canonical): Set error for non-existent path. diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index 32c9c5e..9abcee0 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -142,7 +142,11 @@ fs::canonical(const path& p, const path& base, error_code& ec) #endif if (!exists(pa, ec)) - return result; + { + if (!ec) + ec = make_error_code(std::errc::no_such_file_or_directory); + return result; + } // else: we know there are (currently) no unresolvable symlink loops result = pa.root_path(); commit 16b33e71b6b247d3936cddbddac982082e802894 Author: Jonathan Wakely Date: Wed Oct 26 12:14:53 2016 +0100 Add missing header in Filesystem TS configure tests 2016-10-26 Uros Bizjak * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Include for PATH_MAX in realpath test. * configure: Regenerate. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index d0ee45f..1fc4de1 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -4290,6 +4290,7 @@ dnl AC_CACHE_VAL(glibcxx_cv_realpath, [dnl GCC_TRY_COMPILE_OR_LINK( [ + #include #include #include ],