Thread (8 messages) flat view 8 messages, 4 authors, 2016-06-15

Re: [PATCH] remove unnecessary loop

From: Liu Yubao <hidden>
Date: 2016-06-15 22:43:09

Jan Hudec wrote:
On Tue, May 08, 2007 at 12:49:35 +0800, Liu Yubao wrote:
quoted
+#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...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help