diff options
author | David Robillard <d@drobilla.net> | 2021-10-09 13:44:31 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-28 21:57:07 -0500 |
commit | cbf01be4126cbc0f6d80364a7e0b6ad777a7d8ae (patch) | |
tree | 20cd2919e0d4c47caa346123c5701daa70a05ac3 /tools | |
parent | 5ea7c0d763685c23dc6933e273dfa11eec5bec14 (diff) | |
download | serd-cbf01be4126cbc0f6d80364a7e0b6ad777a7d8ae.tar.gz serd-cbf01be4126cbc0f6d80364a7e0b6ad777a7d8ae.tar.bz2 serd-cbf01be4126cbc0f6d80364a7e0b6ad777a7d8ae.zip |
Fix handling of deferred write errors that happen when closing
Diffstat (limited to 'tools')
-rw-r--r-- | tools/console.c | 6 | ||||
-rw-r--r-- | tools/serd-filter.c | 2 | ||||
-rw-r--r-- | tools/serd-pipe.c | 2 | ||||
-rw-r--r-- | tools/serd-sort.c | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/tools/console.c b/tools/console.c index 3b209273..c6e55c17 100644 --- a/tools/console.c +++ b/tools/console.c @@ -372,8 +372,10 @@ serd_open_tool_output(const char* const filename) { if (!filename || !strcmp(filename, "-")) { serd_set_stream_utf8_mode(stdout); - return serd_open_output_stream( - (SerdWriteFunc)fwrite, (SerdCloseFunc)fclose, stdout); + return serd_open_output_stream((SerdWriteFunc)fwrite, + (SerdErrorFunc)ferror, + (SerdCloseFunc)fclose, + stdout); } return serd_open_output_file(filename); diff --git a/tools/serd-filter.c b/tools/serd-filter.c index 0804d6ba..b172d05d 100644 --- a/tools/serd-filter.c +++ b/tools/serd-filter.c @@ -127,7 +127,7 @@ log_error(SerdWorld* const world, const char* const fmt, ...) static SerdStatus run(Options opts) { - SerdTool app = {{NULL, NULL, NULL}, NULL, NULL, NULL}; + SerdTool app = {{NULL, NULL, NULL, NULL}, NULL, NULL, NULL}; // Set up the writing environment SerdStatus st = SERD_SUCCESS; diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c index f2891f9b..612826ca 100644 --- a/tools/serd-pipe.c +++ b/tools/serd-pipe.c @@ -39,7 +39,7 @@ typedef struct { static SerdStatus run(const Options opts) { - SerdTool app = {{NULL, NULL, NULL}, NULL, NULL, NULL}; + SerdTool app = {{NULL, NULL, NULL, NULL}, NULL, NULL, NULL}; // Set up the writing environment SerdStatus st = SERD_SUCCESS; diff --git a/tools/serd-sort.c b/tools/serd-sort.c index 7219fa26..267e75f8 100644 --- a/tools/serd-sort.c +++ b/tools/serd-sort.c @@ -57,7 +57,7 @@ input_has_graphs(const Options opts) static SerdStatus run(const Options opts) { - SerdTool app = {{NULL, NULL, NULL}, NULL, NULL, NULL}; + SerdTool app = {{NULL, NULL, NULL, NULL}, NULL, NULL, NULL}; // Set up the writing environment SerdStatus st = SERD_SUCCESS; |