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

Re: [PATCH] remove unnecessary loop

From
Alex Riesen <raa.lkml@gmail.com>
Date
May 8, 2007, 09:08 UTC
Message-ID
<81b0412b0705080208x3713cbc1y3c870383b586c877@mail.gmail.com>
In-Reply-To
<4640015F.1080407@gmail.com>
On 5/8/07, Liu Yubao <yubao.liu@gmail.com> wrote:
Show 6 quoted lines
> +#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))) {

This does not "test again" if lstat returns 0. If lstat returns 0 (file stat info obtained) the open is not even called. Besides, cygwin lies not only about .exe but also about .lnk files.

P.S. Somehow I have the feeling that even if it is a stupidity in cygwin they will not fix it (nor will they admit it is a bug).

Previous: Junio C HamanoNext: Jan Hudec
Message 4 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.