From bb6936a0ae6947348d737fd6cea37a457b7909ac Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 13 Apr 2020 23:36:04 -0700 Subject: streams: fix reversed order of items in error diagnostic. * stream.c (stdio_maybe_error): We want to say "error whatever-ing #": the action has to come first, and from the format specifiers being ~a ~s, that was clearly the intent. --- stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream.c') diff --git a/stream.c b/stream.c index bd8d463e..8856d9b8 100644 --- a/stream.c +++ b/stream.c @@ -573,14 +573,14 @@ static val stdio_maybe_error(val stream, val action) struct stdio_handle *h = coerce(struct stdio_handle *, stream->co.handle); val err = num(errno); if (h->f == 0) - uw_throwf(file_error_s, lit("error ~a ~s: file closed"), stream, action, nao); + uw_throwf(file_error_s, lit("error ~a ~s: file closed"), action, stream, nao); h->err = err; #ifdef EAGAIN if (errno == EAGAIN) uw_throwf(timeout_error_s, lit("timed out on ~s"), stream, nao); #endif uw_throwf(file_error_s, lit("error ~a ~s: ~d/~s"), - stream, action, err, errno_to_string(err), nao); + action, stream, err, errno_to_string(err), nao); } static int se_putc(int ch, FILE *f) -- cgit v1.2.3