diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-03-10 13:15:58 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2015-03-10 13:15:58 +0200 |
commit | 255fd81d79c49f6e5dbdb0df371d8ec7de600917 (patch) | |
tree | a2e60a2e8048832c5b15afef86943505261c1ad4 /src/info.c | |
parent | 2a6896b2b4809849441756046ee7d8ad34abab34 (diff) | |
download | apk-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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); } |