[systemd-devel] [PATCH 3/3] Cleaned up test path assignment code.
Ken Sedgwick
ksedgwic at bonsai.com
Tue Oct 7 12:12:13 PDT 2014
---
src/test/test-enabled.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/test/test-enabled.c b/src/test/test-enabled.c
index 607f68c..104348e 100644
--- a/src/test/test-enabled.c
+++ b/src/test/test-enabled.c
@@ -75,9 +75,6 @@
*/
-const char *subdir = "/test-enabled-root";
-char root_dir[UNIT_NAME_MAX + 2 + 1] = TEST_DIR;
-
#define confirm_unit_state(unit, expected) \
assert_se(unit_file_get_state(UNIT_FILE_SYSTEM, root_dir,
unit) == expected)
@@ -86,8 +83,9 @@ static void test_enabled(int argc, char* argv[]) {
UnitFileList *p;
Iterator i;
int r;
+ const char *root_dir;
- strncat(root_dir, subdir, strlen(subdir));
+ root_dir = strappenda(TEST_DIR, "/test-enabled-root");
confirm_unit_state("nonexistent.service", -ENOENT);
confirm_unit_state("invalid.service", -EBADMSG);
--
1.9.3
More information about the systemd-devel
mailing list