Mercurial > hg > th-libs
comparison th_ioctx_stdio.c @ 737:6b778871f770
Return actual errno status in case of fopen() failure.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Dec 2022 15:03:36 +0200 |
parents | 31bc1ed07cf5 |
children | c17eadc60c3d |
comparison
equal
deleted
inserted
replaced
736:ca837a4417f5 | 737:6b778871f770 |
---|---|
13 | 13 |
14 static int th_stdio_fopen(th_ioctx *ctx) | 14 static int th_stdio_fopen(th_ioctx *ctx) |
15 { | 15 { |
16 ctx->data = (void *) fopen(ctx->filename, ctx->mode); | 16 ctx->data = (void *) fopen(ctx->filename, ctx->mode); |
17 ctx->status = th_get_error(); | 17 ctx->status = th_get_error(); |
18 return (ctx->data != NULL) ? THERR_OK : THERR_FOPEN; | 18 return (ctx->data != NULL) ? THERR_OK : ctx->status; |
19 } | 19 } |
20 | 20 |
21 | 21 |
22 static void th_stdio_fclose(th_ioctx *ctx) | 22 static void th_stdio_fclose(th_ioctx *ctx) |
23 { | 23 { |