summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-06-24 19:34:07 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-06-24 19:34:07 -0700
commit969e45b5a779460e5445595c438814e043aaee7c (patch)
tree4130056118e3fe8c9ed5551c13b190c84577e7a9
parentc1ee5b68738304906f2071fcbed40cca9c6447c4 (diff)
downloadtxr-969e45b5a779460e5445595c438814e043aaee7c.tar.gz
txr-969e45b5a779460e5445595c438814e043aaee7c.tar.bz2
txr-969e45b5a779460e5445595c438814e043aaee7c.zip
More HAVE_FORK_STUFF cleanup.
* stream.c (pipe_close_status_helper, pipe_close, pipe_ops): Included in #if HAVE_FORK_STUFF block. (stream_init): Refer to pipe ops only if HAVE_FORK_STUFF is true.
-rw-r--r--stream.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stream.c b/stream.c
index 388020c9..22364448 100644
--- a/stream.c
+++ b/stream.c
@@ -1360,7 +1360,6 @@ static int pipevp_close(FILE *f, pid_t pid)
sig_restore_enable;
return status;
}
-#endif
val pipe_close_status_helper(val stream, val throw_on_error,
int status, val self)
@@ -1406,9 +1405,7 @@ static val pipe_close(val stream, val throw_on_error)
struct stdio_handle *h = coerce(struct stdio_handle *, stream->co.handle);
if (h->f != 0) {
-#if HAVE_FORK_STUFF
int status = pipevp_close(h->f, h->pid);
-#endif
h->f = 0;
return pipe_close_status_helper(stream, throw_on_error, status, self);
@@ -1444,6 +1441,7 @@ static struct strm_ops pipe_ops =
stdio_get_error_str,
stdio_clear_error,
stdio_get_fd);
+#endif
static struct stdio_mode do_parse_mode(val mode_str, struct stdio_mode m_dfl,
val self)
@@ -5590,7 +5588,9 @@ void stream_init(void)
fill_stream_ops(&null_ops);
fill_stream_ops(&stdio_ops);
fill_stream_ops(&tail_ops);
+#if HAVE_FORK_STUFF
fill_stream_ops(&pipe_ops);
+#endif
fill_stream_ops(&string_in_ops);
fill_stream_ops(&byte_in_ops);
fill_stream_ops(&strlist_in_ops);