Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-09-25 02:49:12 +0400
committerChristopher Faylor <me@cgf.cx>2001-09-25 02:49:12 +0400
commit3263838430ad3ccf5db934b37c645a83238ea89a (patch)
tree518c07c89416143325400e7e42da5adda9071f9b
parent35f879a6d0b6c24045570cf882d1474e1ab0de00 (diff)
* select.cc (peek_pipe): Only grab mutex when we actually got something from
the pipe.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/Makefile.in6
-rw-r--r--winsup/cygwin/lib/getopt.c7
-rw-r--r--winsup/cygwin/select.cc10
4 files changed, 19 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d824d8233..5c438d30e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Mon Sep 24 18:46:39 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * select.cc (peek_pipe): Only grab mutex when we actually got something
+ from the pipe.
+
Mon Sep 24 17:41:03 2001 Christopher Faylor <cgf@redhat.com>
* fhandler.h (fhandler_pipe::hit_eof): New method.
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index c18a37745..23012c75d 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -179,9 +179,6 @@ maintainer-clean realclean: clean
# Rule to build libcygwin.a
-$(LIB_NAME): new-$(DLL_NAME) $(LIBCOS)
- $(AR) rcv $(LIB_NAME) $(LIBCOS)
-
# Rule to make stub library used by testsuite
# dependency set to $(LIB_NAME) to accomodate make -j2.
@@ -199,6 +196,9 @@ new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(
$(DLL_IMPORTS) $(MALLOC_OBJ) $(LIBM) $(LIBC) \
-lstdc++ -lgcc -lshell32 -luuid
+$(LIB_NAME): new-$(DLL_NAME) $(LIBCOS)
+ $(AR) rcv $(LIB_NAME) $(LIBCOS)
+
dll_ofiles: $(DLL_OFILES)
$(LIBGMON_A): $(GMON_OFILES) $(GMON_START)
diff --git a/winsup/cygwin/lib/getopt.c b/winsup/cygwin/lib/getopt.c
index e5e4f31a0..12763ea9b 100644
--- a/winsup/cygwin/lib/getopt.c
+++ b/winsup/cygwin/lib/getopt.c
@@ -77,7 +77,12 @@ extern char __declspec(dllimport) *__progname;
#define IGNORE_FIRST (*options == '-' || *options == '+')
#define PRINT_ERROR ((opterr) && ((*options != ':') \
|| (IGNORE_FIRST && options[1] != ':')))
-#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL)
+#if defined(__CYGWIN__) || defined(__MINGW32__)
+# define IS_POSIXLY_CORRECT (1)
+#else
+# define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL)
+#endif
+
#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST)
/* XXX: GNU ignores PC if *options == '-' */
#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-')
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index b01d833ef..6520f4b70 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -449,17 +449,17 @@ peek_pipe (select_record *s, int ignra, HANDLE guard_mutex = NULL)
if (fh->get_device () == FH_PIPEW)
/* nothing */;
+ else if (!PeekNamedPipe (h, NULL, 0, NULL, (DWORD *) &n, NULL))
+ {
+ select_printf ("%s, PeekNamedPipe failed, %E", fh->get_name ());
+ n = -1;
+ }
else if (guard_mutex && WaitForSingleObject (guard_mutex, 0) != WAIT_OBJECT_0)
{
select_printf ("%s, couldn't get mutex %p, %E", fh->get_name (),
guard_mutex);
n = 0;
}
- else if (!PeekNamedPipe (h, NULL, 0, NULL, (DWORD *) &n, NULL))
- {
- select_printf ("%s, PeekNamedPipe failed, %E", fh->get_name ());
- n = -1;
- }
if (n < 0)
{