summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-10-16 19:13:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2011-10-16 19:13:01 -0700
commit3cdd67db736815caafc8007df6930777691316a4 (patch)
treec7457dca97de8c6656525040bb53d7930be52b7a /stream.c
parent477eb2cd965f8f7151cc21e04fe60dd09d703585 (diff)
downloadtxr-3cdd67db736815caafc8007df6930777691316a4.tar.gz
txr-3cdd67db736815caafc8007df6930777691316a4.tar.bz2
txr-3cdd67db736815caafc8007df6930777691316a4.zip
Quick and dirty port to MinGW.
* configure: Test for presence of <sys/wait.h> added. Conditionally generates HAVE_SYS_WAIT variable in config.h. * stream.c: Include <sys/wait.h> conditionally. (pipe_close): Do not test ermination status with WIFEXITED, etc. if there is no <sys/wait.h> header.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index d9885971..4e728d86 100644
--- a/stream.c
+++ b/stream.c
@@ -34,8 +34,10 @@
#include <errno.h>
#include <wchar.h>
#include <unistd.h>
-#include <sys/wait.h>
#include "config.h"
+#if HAVE_SYS_WAIT
+#include <sys/wait.h>
+#endif
#include "lib.h"
#include "gc.h"
#include "unwind.h"
@@ -247,6 +249,7 @@ static val pipe_close(val stream, val throw_on_error)
uw_throwf(process_error_s,
lit("unable to obtain status of command ~a: ~a/~s"),
stream, num(errno), string_utf8(strerror(errno)), nao);
+#ifdef HAVE_SYS_WAIT
} else if (WIFEXITED(status)) {
int exitstatus = WEXITSTATUS(status);
uw_throwf(process_error_s, lit("pipe ~a terminated with status ~a"),
@@ -263,6 +266,7 @@ static val pipe_close(val stream, val throw_on_error)
} else {
uw_throwf(file_error_s, lit("strange status in when closing pipe ~a"),
stream, nao);
+#endif
}
}