diff options
author | Fabian Groffen <grobian@gentoo.org> | 2020-01-22 21:09:07 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2020-01-22 21:09:07 +0100 |
commit | bdda53e4e914c44b1c278c6df1e726ba5170cff0 (patch) | |
tree | e2978d7351c000db835becde2230b32f1098cae2 /qmanifest.c | |
parent | qmanifest: fix Coverity 206530 Explicit null dereferenced (diff) | |
download | portage-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.c | 6 |
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 */ |