Mercurial > hg > th-libs
diff th_ioctx.c @ 519:e1b15fb56ddf
Change return value of th_io_error() and th_io_error_v() to int, and return the error code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Dec 2019 13:07:09 +0200 |
parents | e4ce60239d16 |
children | 3a852e9f70a6 |
line wrap: on
line diff
--- a/th_ioctx.c Thu Dec 26 13:05:40 2019 +0200 +++ b/th_ioctx.c Thu Dec 26 13:07:09 2019 +0200 @@ -108,7 +108,7 @@ } -void th_io_error_v(th_ioctx *ctx, const int err, const char *fmt, va_list ap) +int th_io_error_v(th_ioctx *ctx, const int err, const char *fmt, va_list ap) { char *msg = th_strdup_vprintf(fmt, ap); @@ -118,15 +118,17 @@ THERR("'%s' #%" PRIu_SIZE_T ": %s\n", ctx->filename, ctx->line, msg); th_free(msg); + return err; } -void th_io_error(th_ioctx *ctx, const int err, const char *fmt, ...) +int th_io_error(th_ioctx *ctx, const int err, const char *fmt, ...) { va_list ap; va_start(ap, fmt); th_io_error_v(ctx, err, fmt, ap); va_end(ap); + return err; }