]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: use pclose() for popen()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 14 Sep 2020 20:32:52 +0000 (22:32 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 14 Sep 2020 20:32:52 +0000 (22:32 +0200)
Coverity CID#1432701.

src/test/test-env-file.c
src/test/test-fileio.c

index 861238169ba602221bd7188ff709057b20ef4dfe..23779b9b8775999c5dc40f1c40281a795681f1f0 100644 (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);
index 9c0b3533c24b2d6824f9cbefb1c0df8d442b7ee5..ce5af43db5796d5cd3fc08fea6facc9ef84af99b 100644 (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, "\""));