From d2d44f76c4d86017ccbe6f70ef6318d71947e6d7 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 21 Sep 2013 17:37:59 -0400 Subject: Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNC --- output.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'output.c') 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 -- cgit v1.2.3