Merge pull request #17055 from keszybz/two-coverity-fixes

Two coverity fixes
This commit is contained in:
Yu Watanabe 2020-09-15 09:22:39 +09:00 committed by GitHub
commit c2c61531a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -482,7 +482,7 @@ static int hardlink_context_realize(HardlinkContext *c) {
c->dir_fd = openat(c->parent_fd, c->subdir, O_RDONLY|O_DIRECTORY|O_CLOEXEC);
if (c->dir_fd < 0) {
r = -errno;
unlinkat(c->parent_fd, c->subdir, AT_REMOVEDIR);
(void) unlinkat(c->parent_fd, c->subdir, AT_REMOVEDIR);
return r;
}

View File

@ -151,7 +151,7 @@ static void test_write_and_load_env_file(void) {
_cleanup_(unlink_and_freep) char *p = NULL;
_cleanup_strv_free_ char **l = NULL;
_cleanup_free_ char *j = NULL, *w = NULL, *cmd = NULL, *from_shell = NULL;
_cleanup_fclose_ FILE *f = NULL;
_cleanup_pclose_ FILE *f = NULL;
size_t sz;
assert_se(tempfn_random_child(NULL, NULL, &p) >= 0);

View File

@ -153,7 +153,7 @@ static void test_parse_env_file(void) {
static void test_one_shell_var(const char *file, const char *variable, const char *value) {
_cleanup_free_ char *cmd = NULL, *from_shell = NULL;
_cleanup_fclose_ FILE *f = NULL;
_cleanup_pclose_ FILE *f = NULL;
size_t sz;
assert_se(cmd = strjoin(". ", file, " && /bin/echo -n \"$", variable, "\""));