summaryrefslogtreecommitdiff
path: root/src/info.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/info.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/info.c')
-rw-r--r--src/info.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/info.c b/src/info.c
index 43ced63..b163aa5 100644
--- a/src/info.c
+++ b/src/info.c
@@ -130,9 +130,11 @@ static void info_who_owns(struct info_ctx *ctx, struct apk_database *db,
}
if (apk_verbosity < 1 && deps->num != 0) {
os = apk_ostream_to_fd(STDOUT_FILENO);
- apk_deps_write(db, deps, os, APK_BLOB_PTR_LEN(" ", 1));
- os->write(os, "\n", 1);
- os->close(os);
+ if (!IS_ERR_OR_NULL(os)) {
+ apk_deps_write(db, deps, os, APK_BLOB_PTR_LEN(" ", 1));
+ os->write(os, "\n", 1);
+ os->close(os);
+ }
}
apk_dependency_array_free(&deps);
}