aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-01-22 21:09:07 +0100
committerFabian Groffen <grobian@gentoo.org>2020-01-22 21:09:07 +0100
commitbdda53e4e914c44b1c278c6df1e726ba5170cff0 (patch)
treee2978d7351c000db835becde2230b32f1098cae2 /qmanifest.c
parentqmanifest: fix Coverity 206530 Explicit null dereferenced (diff)
downloadportage-utils-bdda53e4e914c44b1c278c6df1e726ba5170cff0.tar.gz
portage-utils-bdda53e4e914c44b1c278c6df1e726ba5170cff0.tar.bz2
portage-utils-bdda53e4e914c44b1c278c6df1e726ba5170cff0.zip
qmanifest: fix Coverity 206535 Unchecked return value
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qmanifest.c')
-rw-r--r--qmanifest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/qmanifest.c b/qmanifest.c
index 31c4696f..b4057bb9 100644
--- a/qmanifest.c
+++ b/qmanifest.c
@@ -690,7 +690,11 @@ generate_dir(const char *dir, enum type_manifest mtype)
fclose(m);
snprintf(path, sizeof(path), "%s/%s", dir, str_manifest);
- rename(newmanifest, path);
+ if (rename(newmanifest, path) == -1) {
+ fprintf(stderr, "failed to rename file '%s' to '%s': %s\n",
+ newmanifest, path, strerror(errno));
+ return NULL;
+ }
if (tv[0].tv_sec != 0) {
/* set Manifest and dir mtime to most recent file we found */