summaryrefslogtreecommitdiffstats
path: root/src/test/test-path.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-10-23 17:16:57 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-10-27 20:55:22 +0200
commit4150584e63562616e16242f7b1016c0e642fb59e (patch)
tree82f6703a6879d6876456e03b0ef3d50dbbc5a373 /src/test/test-path.c
parentMerge pull request #21143 from yuwata/sd-radv-router-lifetime (diff)
downloadsystemd-4150584e63562616e16242f7b1016c0e642fb59e.tar.xz
systemd-4150584e63562616e16242f7b1016c0e642fb59e.zip
test: do not use alloca() in function call
Diffstat (limited to '')
-rw-r--r--src/test/test-path.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/test-path.c b/src/test/test-path.c
index 04cb4fa37c..529487d1ad 100644
--- a/src/test/test-path.c
+++ b/src/test/test-path.c
@@ -306,7 +306,7 @@ static void test_path_unit(Manager *m) {
}
static void test_path_directorynotempty(Manager *m) {
- const char *test_path = "/tmp/test-path_directorynotempty/";
+ const char *test_file, *test_path = "/tmp/test-path_directorynotempty/";
Unit *unit = NULL;
Path *path = NULL;
Service *service = NULL;
@@ -328,7 +328,8 @@ static void test_path_directorynotempty(Manager *m) {
assert_se(access(test_path, F_OK) < 0);
assert_se(mkdir_p(test_path, 0755) >= 0);
- assert_se(touch(strjoina(test_path, "test_file")) >= 0);
+ test_file = strjoina(test_path, "test_file");
+ assert_se(touch(test_file) >= 0);
if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0)
return;