X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_54,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Message-ID: <49695017.20501@byu.net> Date: Sat, 10 Jan 2009 18:49:11 -0700 From: Eric Blake User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: find assert (was Re: [1.7] System reboot (udfs.sys),...) References: <495A4B87 DOT 3080009 AT partners DOT org> <20081230170638 DOT GB5230 AT ednor DOT casa DOT cgf DOT cx> <20081230174104 DOT GD5230 AT ednor DOT casa DOT cgf DOT cx> <20081230175246 DOT GE5230 AT ednor DOT casa DOT cgf DOT cx> <20081230190603 DOT GA13443 AT ednor DOT casa DOT cgf DOT cx> <20090108153111 DOT GA18089 AT calimero DOT vinschen DOT de> <20090109114535 DOT GG19133 AT calimero DOT vinschen DOT de> In-Reply-To: <20090109114535.GG19133@calimero.vinschen.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Corinna Vinschen on 1/9/2009 4:45 AM: >>> state.type is set in the calling function find() like this: >>> >>> while ( (ent=fts_read(p)) != NULL ) >>> { >>> state.have_type = !!ent->fts_statp->st_mode; >>> state.type = state.have_type ? ent->fts_statp->st_mode : 0; >>> } >>> >>> which is a bug, AFAICS. The bug is not here, since gnulib's fts is smart enough to populate ent->fts_statp->st_mode (but nothing else) using d_type information learned during readdir when FTS_NOSTAT is requested, thus deferring (or avoiding) the need for stat. In other words, state.type can be valid even when a FTS_NSOK or FTS_NS. But the later assertion is a bug, since it is possible to have neither the stat (since find used FTS_NOSTAT) nor a type (when d_type was DT_UNKNOWN), in which case a stat must be performed. - -- Don't work too hard, make some time for fun as well! Eric Blake ebb9 AT byu DOT net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklpUBcACgkQ84KuGfSFAYCwvwCfZRvs0DRCoBL+YRsqgs5HbF6y kXcAoJjbwRzxqCHcxHLady4XB/MNLUFX =K7yf -----END PGP SIGNATURE----- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/