git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] remove unnecessary loop

From
LYLiu Yubao <yubao.liu@gmail.com>
Date
May 9, 2007, 01:03 UTC
Message-ID
<46411DEA.6060404@gmail.com>
In-Reply-To
<20070508093902.GB9007@efreet.light.src>
Jan Hudec wrote:
Show 17 quoted lines
> On Tue, May 08, 2007 at 12:49:35 +0800, Liu Yubao wrote:
>> +#ifdef __CYGWIN__
>> +		/*
>> +		 * On cygwin, lstat("hello", &st) returns 0 when
>> +		 * "hello.exe" exists, so test with open() again.
>> +		 */
>> +		if (lstat(match, &st) && -1 != (fd = open(match, O_RDONLY))) {
>> +			struct dir_entry *ent;
>> +			close(fd);
>> +#else
>>  		if (!lstat(match, &st)) {
>>  			struct dir_entry *ent;
>> -
>> +#endif
> 
> You seem to have reversed the sense of the test.
> 
Sorry I made a mistake, Junio's suggestion is pretty clean, and
that test should be
		if (!lstat(match, &st) && -1 != (fd = open(match, O_RDONLY))) {

Yesterday I digged the Cygwin mail archive, I found it's a concession for windows as you said in the previous message. I agree with you, just let it be.

Once more, I get the lesson: Windows is poor, sigh...
Previous: Jan Hudec
Message 9 of 9 in “remove unnecessary loop”
  1. remove unnecessary loopLiu Yubao, May 8, 2007
  2. Liu YubaoMay 8, 2007
  3. Junio C HamanoMay 8, 2007
  4. Alex RiesenMay 8, 2007
  5. Jan HudecMay 8, 2007
  6. Alex RiesenMay 8, 2007
  7. Eric BlakeMay 8, 2007
  8. Jan HudecMay 8, 2007
  9. Liu YubaoMay 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.