Don't fsync() on a pipe (causes bug #35936)
[mono.git] / support / signal.c
index 28146c02611a82acbc253cd4b87f8aaa4ca8db4a..a018bc67928443744109fb0427ec516df7e66d4d 100644 (file)
@@ -184,7 +184,6 @@ default_handler (int signum)
                        for (j = 0; j < pipecounter; ++j) {
                                int r;
                                do { r = write (fd, &c, 1); } while (keep_trying (r));
-                               fsync (fd); /* force */
                        }
                }
        }
@@ -195,6 +194,7 @@ static pthread_mutex_t signals_mutex = PTHREAD_MUTEX_INITIALIZER;
 void*
 Mono_Unix_UnixSignal_install (int sig)
 {
+#if defined(HAVE_SIGNAL)
        int i;
        signal_info* h = NULL; 
        int have_handler = 0;
@@ -252,6 +252,10 @@ Mono_Unix_UnixSignal_install (int sig)
        release_mutex (&signals_mutex);
 
        return h;
+#else
+       g_error ("signal() is not supported by this platform");
+       return 0;
+#endif
 }
 
 static int
@@ -269,6 +273,7 @@ count_handlers (int signum)
 int
 Mono_Unix_UnixSignal_uninstall (void* info)
 {
+#if defined(HAVE_SIGNAL)       
        signal_info* h;
        int r = -1;
 
@@ -294,6 +299,10 @@ Mono_Unix_UnixSignal_uninstall (void* info)
        release_mutex (&signals_mutex);
 
        return r;
+#else
+       g_error ("signal() is not supported by this platform");
+       return 0;
+#endif
 }
 
 static int