X-Spam-Check-By: sourceware.org Date: Mon, 27 Feb 2006 12:41:27 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: d_ino bug in // Message-ID: <20060227174127.GC12768@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <022720061722 DOT 16369 DOT 440335710004E8DA00003FF122007507840A050E040D0C079D0A AT comcast DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <022720061722.16369.440335710004E8DA00003FF122007507840A050E040D0C079D0A@comcast.net> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 On Mon, Feb 27, 2006 at 05:22:57PM +0000, Eric Blake wrote: >It looks like d_ino is not being correctly populated within //. >Running the program below on snapshot 20060220 produced: A (somewhat) simple test case (patent pending) is nice but it really should be accompanied with an explanation of the problem. How about describing *in words* what you think is broken? cgf >$ ./foo >Searching for //eblake, inode 10556217422951964268 >entry 553: name match only (inode 14394969718775064264) >2098 entries processed >$ cat foo.c >#include >#include >#include >#include >#include >#include > >#define DEFAULT_SHARE "eblake" > >int main(int argc, char**argv) >{ > ino_t ino; > struct stat sb; > DIR *dirp; > int i = 0; > > switch (argc) > { > case 1: > argv[1] = DEFAULT_SHARE; > break; > case 2: > break; > default: > printf("Usage: foo [sharename]\n" > " Search // for sharename\n"); > return 1; > } > > if (chdir("//") < 0) > { > printf("chdir failed: %d %s\n", errno, strerror(errno)); > return 1; > } > if (lstat(argv[1], &sb) < 0) > { > printf("lstat failed: %d %s\n", errno, strerror(errno)); > return 1; > } > ino = sb.st_ino; > printf("Searching for //%s, inode %llu\n", argv[1], ino); > if ((dirp = opendir ("..")) == NULL) > { > printf("opendir failed: %d %s\n", errno, strerror(errno)); > return 1; > } > while (1) > { > struct dirent *dp; > > errno = 0; > i++; > if ((dp = readdir (dirp)) == NULL) > { > if (errno) > { > printf("opendir failed: %d %s\n", errno, strerror(errno)); > return 2; > } > else > break; > } > if (ino == dp->d_ino) > { > if (strcasecmp(argv[1], dp->d_name) == 0) > { > printf("match found at entry %d\n", i); > } > else > { > printf("entry %d: inode match only (name %s)\n", i, dp->d_name); > } > } > else if (strcasecmp(argv[1], dp->d_name) == 0) > { > printf("entry %d: name match only (inode %llu)\n", i, dp->d_ino); > } > } > printf("%d entries processed\n", i); > if (closedir (dirp) < 0) > { > printf("closedir failed: %d %s\n", errno, strerror(errno)); > return 1; > } > return 0; >} -- 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/