From 255fd81d79c49f6e5dbdb0df371d8ec7de600917 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Tue, 10 Mar 2015 13:15:58 +0200 Subject: rework error handling for write streams --- src/index.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/index.c') diff --git a/src/index.c b/src/index.c index 2fe8cb4..ccb4713 100644 --- a/src/index.c +++ b/src/index.c @@ -205,6 +205,7 @@ static int index_main(void *ctx, struct apk_database *db, struct apk_string_arra os = apk_ostream_to_file(AT_FDCWD, ictx->output, NULL, 0644); else os = apk_ostream_to_fd(STDOUT_FILENO); + if (IS_ERR_OR_NULL(os)) return -1; if (ictx->method == APK_SIGN_GENERATE) { struct apk_ostream *counter; -- cgit v1.2.3-60-g2f50