From: Zbigniew Jędrzejewski-Szmek Date: Mon, 14 Sep 2020 20:32:52 +0000 (+0200) Subject: test: use pclose() for popen() X-Git-Tag: v247-rc1~236^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=649bde89caccdb1187ac744bd76051fdcd687218;p=thirdparty%2Fsystemd.git test: use pclose() for popen() Coverity CID#1432701. --- diff --git a/src/test/test-env-file.c b/src/test/test-env-file.c index 861238169ba..23779b9b877 100644 --- a/src/test/test-env-file.c +++ b/src/test/test-env-file.c @@ -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); diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index 9c0b3533c24..ce5af43db57 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -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, "\""));