summaryrefslogtreecommitdiff
path: root/output.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-21 17:37:59 -0400
committerPaul Smith <psmith@gnu.org>2013-09-21 17:37:59 -0400
commitd2d44f76c4d86017ccbe6f70ef6318d71947e6d7 (patch)
tree8e22c54c2772d214116a761a5bebd37ff721b101 /output.c
parent6c3e88e60f2c7d2bff3aa1967afcc59f27626c48 (diff)
downloadgunmake-d2d44f76c4d86017ccbe6f70ef6318d71947e6d7.tar.gz
Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNC
Diffstat (limited to 'output.c')
-rw-r--r--output.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/output.c b/output.c
index 32334eb..f58b816 100644
--- a/output.c
+++ b/output.c
@@ -42,6 +42,12 @@ unsigned int stdio_traced = 0;
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
+#ifdef HAVE_FCNTL
+# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
+#else
+# define STREAM_OK(_s) 1
+#endif
+
/* I really want to move to gnulib. However, this is a big undertaking
especially for non-UNIX platforms: how to get bootstrapping to work, etc.
I don't want to take the time to do it right now. Use a hack to get a
@@ -178,13 +184,11 @@ set_append_mode (int fd)
}
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
/* Semaphore for use in -j mode with output_sync. */
static sync_handle_t sync_handle = -1;
-#define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
-
#define FD_NOT_EMPTY(_f) ((_f) != OUTPUT_NONE && lseek ((_f), 0, SEEK_END) > 0)
/* Set up the sync handle. Disables output_sync on error. */
@@ -409,7 +413,7 @@ output_dump (struct output *out)
}
}
}
-#endif /* OUTPUT_SYNC */
+#endif /* NO_OUTPUT_SYNC */
/* Provide support for temporary files. */
@@ -555,7 +559,7 @@ output_close (struct output *out)
return;
}
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
output_dump (out);
#endif
@@ -571,7 +575,7 @@ output_close (struct output *out)
void
output_start ()
{
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
if (output_context && output_context->syncout && ! OUTPUT_ISSET(output_context))
setup_tmpfile (output_context);
#endif