Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 8663D431FBC for ; Tue, 22 Dec 2009 15:02:54 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I3kLPi+E+qqB for ; Tue, 22 Dec 2009 15:02:54 -0800 (PST) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by olra.theworths.org (Postfix) with ESMTP id DE0D5431FAE for ; Tue, 22 Dec 2009 15:02:53 -0800 (PST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NNDkg-0004xG-7W for notmuch@notmuchmail.org; Wed, 23 Dec 2009 00:02:50 +0100 Received: from ip-118-90-130-94.xdsl.xnet.co.nz ([118.90.130.94]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Dec 2009 00:02:50 +0100 Received: from olly by ip-118-90-130-94.xdsl.xnet.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Dec 2009 00:02:50 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: notmuch@notmuchmail.org From: Olly Betts Date: Tue, 22 Dec 2009 23:02:25 +0000 (UTC) Lines: 17 Message-ID: References: <1261450617-24616-1-git-send-email-tom@dbservice.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 118.90.130.94 (Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.6) Gecko/20091215 Ubuntu/9.10 (karmic) Firefox/3.5.6) Sender: news Subject: Re: [notmuch] [PATCH] Add post-add and post-tag hooks X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 23:02:54 -0000 Tomas Carnecky writes: > #if defined(__sun__) > ... sprintf, stat etc > #else > (void) path; > return dirent->d_type == DT_DIR; > #endif Rather than a platform-specific check, it would be better to check if DT_DIR is defined. Beware that even on Linux (where the d_type field is present), it may always contain DT_UNKNOWN for some filesystems, so you really should check for that case and fall back to using stat() instead. Cheers, Olly