aboutsummaryrefslogtreecommitdiffstats
path: root/sync_pipe_write.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-09-29 01:15:11 +0000
committerGuy Harris <guy@alum.mit.edu>2007-09-29 01:15:11 +0000
commit6d065e2eb2792e6b4add180d7ac6190ecff3f925 (patch)
tree9705008887dc92c151701e1222c26140e4d98246 /sync_pipe_write.c
parent343fa12c8260ecb9e98956871cff7cf0a6194051 (diff)
Don't hardcode the notion that the sync pipe is the standard output into
sync_pipe_errmsg_to_parent(); have it take the FD for the sync pipe as an argument. svn path=/trunk/; revision=23024
Diffstat (limited to 'sync_pipe_write.c')
-rw-r--r--sync_pipe_write.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sync_pipe_write.c b/sync_pipe_write.c
index d0def511ce..337e0414b4 100644
--- a/sync_pipe_write.c
+++ b/sync_pipe_write.c
@@ -104,11 +104,12 @@ pipe_write_block(int pipe, char indicator, const char *msg)
void
-sync_pipe_errmsg_to_parent(const char *error_msg, const char *secondary_error_msg)
+sync_pipe_errmsg_to_parent(int pipe, const char *error_msg,
+ const char *secondary_error_msg)
{
/* first write a "master header" with the length of the two messages plus their "slave headers" */
- pipe_write_header(1, SP_ERROR_MSG, strlen(error_msg) + 1 + 4 + strlen(secondary_error_msg) + 1 + 4);
- pipe_write_block(1, SP_ERROR_MSG, error_msg);
- pipe_write_block(1, SP_ERROR_MSG, secondary_error_msg);
+ pipe_write_header(pipe, SP_ERROR_MSG, strlen(error_msg) + 1 + 4 + strlen(secondary_error_msg) + 1 + 4);
+ pipe_write_block(pipe, SP_ERROR_MSG, error_msg);
+ pipe_write_block(pipe, SP_ERROR_MSG, secondary_error_msg);
}