diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-10-23 10:50:38 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-10-26 12:56:53 +0200 |
commit | 75e7d50e261c42d3de9afc7ad7368308f45c1498 (patch) | |
tree | fa5e5c7cd5f41b8bc7510f0cdc11a10cfd3b0f02 /src/test/test-env-util.c | |
parent | Introduce fmkostemp_safe and use it in tests (diff) | |
download | systemd-75e7d50e261c42d3de9afc7ad7368308f45c1498.tar.xz systemd-75e7d50e261c42d3de9afc7ad7368308f45c1498.zip |
test: _cleanup_(unlink_tempfilep) in two more places
Diffstat (limited to '')
-rw-r--r-- | src/test/test-env-util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/test-env-util.c b/src/test/test-env-util.c index 0ab671b476..815fb340af 100644 --- a/src/test/test-env-util.c +++ b/src/test/test-env-util.c @@ -6,6 +6,7 @@ #include "env-util.h" #include "fd-util.h" #include "fileio.h" +#include "fs-util.h" #include "serialize.h" #include "string-util.h" #include "strv.h" @@ -321,7 +322,7 @@ static void test_deserialize_environment(void) { static void test_serialize_environment(void) { _cleanup_strv_free_ char **env = NULL, **env2 = NULL; - char fn[] = "/tmp/test-env-util.XXXXXXX"; + _cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-env-util.XXXXXXX"; _cleanup_fclose_ FILE *f = NULL; int r; @@ -358,8 +359,6 @@ static void test_serialize_environment(void) { assert_se(feof(f)); assert_se(strv_equal(env, env2)); - - unlink(fn); } int main(int argc, char *argv[]) { |