From 19cd0e906555325fcb255ad35ae84f468a7f7404 Mon Sep 17 00:00:00 2001 From: Mitch Watrous Date: Tue, 16 Aug 2011 09:41:56 -0700 Subject: [PATCH 1/2] Bug 1243 - exiting waf shell should not generate report on what modules are built --- wscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index 10203db7e..e23c74f0c 100644 --- a/wscript +++ b/wscript @@ -827,7 +827,8 @@ def shutdown(ctx): if ((not Options.options.run) and (not Options.options.pyrun) and ('clean' not in Options.arg_line) - and ('distclean' not in Options.arg_line)): + and ('distclean' not in Options.arg_line) + and ('shell' not in Options.arg_line)): # Print the list of built modules. print From 0bd27b493bea8463c5936afe101ba5d5542a89fb Mon Sep 17 00:00:00 2001 From: Tom Goff Date: Tue, 16 Aug 2011 10:54:12 -0700 Subject: [PATCH 2/2] bug 1220: FdReader always stops with NS_FATAL_ERROR --- src/core/model/unix-fd-reader.cc | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/core/model/unix-fd-reader.cc b/src/core/model/unix-fd-reader.cc index 103ff69e8..71e82e4cd 100644 --- a/src/core/model/unix-fd-reader.cc +++ b/src/core/model/unix-fd-reader.cc @@ -110,15 +110,13 @@ void FdReader::Stop (void) { m_stop = true; - // signal the read thread and close the write end of the event pipe + // signal the read thread if (m_evpipe[1] != -1) { char zero = 0; ssize_t len = write (m_evpipe[1], &zero, sizeof (zero)); if (len != sizeof (zero)) NS_LOG_WARN ("incomplete write(): " << strerror (errno)); - close (m_evpipe[1]); - m_evpipe[1] = -1; } // join the read thread @@ -128,6 +126,13 @@ void FdReader::Stop (void) m_readThread = 0; } + // close the write end of the event pipe + if (m_evpipe[1] != -1) + { + close (m_evpipe[1]); + m_evpipe[1] = -1; + } + // close the read end of the event pipe if (m_evpipe[0] != -1) { @@ -167,26 +172,26 @@ void FdReader::Run (void) if (FD_ISSET (m_evpipe[0], &readfds)) { // drain the event pipe - ssize_t len; for (;;) { char buf[1024]; - len = read (m_evpipe[0], buf, sizeof (buf)); + ssize_t len = read (m_evpipe[0], buf, sizeof (buf)); if (len == 0) { NS_FATAL_ERROR ("event pipe closed"); } if (len < 0) { - break; + if (errno == EAGAIN || errno == EINTR || errno == EWOULDBLOCK) + { + break; + } + else + { + NS_FATAL_ERROR ("read() failed: " << strerror (errno)); + } } } - - if (len < 0 && errno != EAGAIN && errno != EWOULDBLOCK) - { - NS_LOG_WARN ("read() failed: " << strerror (errno)); - break; - } } if (m_stop)