From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6682 invoked by alias); 21 Sep 2012 19:09:29 -0000 Received: (qmail 6665 invoked by uid 22791); 21 Sep 2012 19:09:26 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Sep 2012 19:09:03 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3XNkqx6DgXz4KKBf; Fri, 21 Sep 2012 21:09:01 +0200 (CEST) X-Auth-Info: DVeTEMSPbIsNJFPCE/4MZaqKNwFlOodJimD0Efd+v7c= Received: from igel.home (ppp-88-217-127-217.dynamic.mnet-online.de [88.217.127.217]) by mail.mnet-online.de (Postfix) with ESMTPA id 3XNkqx3b27zbblc; Fri, 21 Sep 2012 21:09:01 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 0520DCA2A5; Fri, 21 Sep 2012 21:09:00 +0200 (CEST) From: Andreas Schwab To: Jan Kratochvil Cc: Eli Zaretskii , khooyp@cs.umd.edu, gdb-patches@sourceware.org Subject: Re: [PATCH 1/2]: Refactor relocate_path to also check if the relocated file/directory exists References: <21ACC598-F6B4-4117-BA7B-B316414DE9E3@cs.umd.edu> <20120919130040.GA20442@host2.jankratochvil.net> <20120921182637.GA8747@host2.jankratochvil.net> <83y5k3w7es.fsf@gnu.org> <20120921184623.GA12696@host2.jankratochvil.net> X-Yow: PIZZA!! Date: Fri, 21 Sep 2012 19:09:00 -0000 In-Reply-To: <20120921184623.GA12696@host2.jankratochvil.net> (Jan Kratochvil's message of "Fri, 21 Sep 2012 20:46:23 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00453.txt.bz2 Jan Kratochvil writes: > It would have to be written as: > if (stat (path, &s) != 0 || !isdir != !S_ISDIR (s.st_mode)) A common idiom is to use !! when the other side is already boolean. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."