summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-03-10 13:15:58 +0200
committerTimo Teräs <timo.teras@iki.fi>2015-03-10 13:15:58 +0200
commit255fd81d79c49f6e5dbdb0df371d8ec7de600917 (patch)
treea2e60a2e8048832c5b15afef86943505261c1ad4 /src/index.c
parent2a6896b2b4809849441756046ee7d8ad34abab34 (diff)
downloadapk-tools-255fd81d79c49f6e5dbdb0df371d8ec7de600917.tar.gz
apk-tools-255fd81d79c49f6e5dbdb0df371d8ec7de600917.tar.bz2
apk-tools-255fd81d79c49f6e5dbdb0df371d8ec7de600917.tar.xz
apk-tools-255fd81d79c49f6e5dbdb0df371d8ec7de600917.zip
rework error handling for write streams
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c1
1 files changed, 1 insertions, 0 deletions
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;