diff options
author | Jonathan Pryor <jpryor@novell.com> | 2010-04-02 20:19:43 +0400 |
---|---|---|
committer | Jonathan Pryor <jpryor@novell.com> | 2010-04-02 20:19:43 +0400 |
commit | 455d6eaecab8bf7673fed719d8a39a5253c7adf4 (patch) | |
tree | 8d7635b67b96e5198a7fb541e994f97cc86b2108 /support | |
parent | 447a8b082e78bbd48aa4838d20b90d372c2f6c7c (diff) |
* Makefile.am: On non-Windows platforms, MonoPosixHelper now links
against libmono.so, for mono_runtime_is_shutting_down().
* signal.c: Only continue retrying system calls if Mono is NOT
attempting to shut down. Fixes #592981.
svn path=/trunk/mono/; revision=154731
Diffstat (limited to 'support')
-rw-r--r-- | support/ChangeLog | 7 | ||||
-rw-r--r-- | support/Makefile.am | 8 | ||||
-rw-r--r-- | support/signal.c | 13 |
3 files changed, 25 insertions, 3 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index 94f69e5608b..d7d1eccd6f0 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,10 @@ +2010-04-02 Jonathan Pryor <jpryor@novell.com> + + * Makefile.am: On non-Windows platforms, MonoPosixHelper now links + against libmono.so, for mono_runtime_is_shutting_down(). + * signal.c: Only continue retrying system calls if Mono is NOT + attempting to shut down. Fixes #592981. + 2010-03-29 Zoltan Varga <vargaz@gmail.com> * mph.h: Applied some changes from the openbsd ports tree to fix openbsd diff --git a/support/Makefile.am b/support/Makefile.am index 59df2c141f2..1646ca103e3 100644 --- a/support/Makefile.am +++ b/support/Makefile.am @@ -103,10 +103,18 @@ libMonoPosixHelper_la_SOURCES = \ $(Z_SOURCE) \ $(MINIZIP_SOURCE) +if HOST_WIN32 libMonoPosixHelper_la_LIBADD = \ $(MPH_LIBS) \ $(Z_LIBS) \ $(XATTR_LIB) +else +libMonoPosixHelper_la_LIBADD = \ + ../mono/mini/libmono-2.0.la \ + $(MPH_LIBS) \ + $(Z_LIBS) \ + $(XATTR_LIB) +endif # libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1 libMonoPosixHelper_la_LDFLAGS = -no-undefined -avoid-version diff --git a/support/signal.c b/support/signal.c index 66f5c0ecb90..11e60e1066e 100644 --- a/support/signal.c +++ b/support/signal.c @@ -24,6 +24,7 @@ #include <string.h> #include <pthread.h> #include <mono/io-layer/atomic.h> +#include <mono/metadata/appdomain.h> #endif G_BEGIN_DECLS @@ -151,6 +152,12 @@ static void release_mutex (pthread_mutex_t *mutex) } } +static inline int +keep_trying (int r) +{ + return r == -1 && errno == EINTR && !mono_runtime_is_shutting_down(); +} + static void default_handler (int signum) { @@ -168,7 +175,7 @@ default_handler (int signum) pipecounter = mph_int_get (&h->pipecnt); for (j = 0; j < pipecounter; ++j) { int r; - do { r = write (fd, &c, 1); } while (r == -1 && errno == EINTR); + do { r = write (fd, &c, 1); } while (keep_trying (r)); fsync (fd); /* force */ } } @@ -338,7 +345,7 @@ wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_s ptv = &tv; } r = poll (fd_structs, count, timeout); - } while (r == -1 && errno == EINTR); + } while (keep_trying (r)); idx = -1; if (r == 0) @@ -352,7 +359,7 @@ wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_s char c; do { r = read (h->read_fd, &c, 1); - } while (r == -1 && errno == EINTR); + } while (keep_trying (r)); if (idx == -1) idx = i; } |