diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-05-29 18:42:40 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-05-29 18:42:40 +0200 |
commit | 8d76eea87b29369c2ca70a95f0dc5c63b879a44f (patch) | |
tree | 5b92cd549f865e884918ef977506047aa4ff7085 /src/core/unit.c | |
parent | 8c35b2ca15a9194412c95ba594712b0d5fe25a64 (diff) | |
parent | 49174f75514bf1033dd6916176a551a923b77dc5 (diff) |
Merge pull request #3378 from keszybz/unit-write-drop-in-newline-removal
Remove newlines from drop in format strings + some formatting fixes
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index 2fff3f2d8b..e98086a3f6 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -3355,7 +3355,7 @@ static const char* unit_drop_in_dir(Unit *u, UnitSetPropertiesMode mode) { int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *data) { _cleanup_free_ char *p = NULL, *q = NULL; - const char *dir, *prefixed; + const char *dir, *wrapped; int r; assert(u); @@ -3374,15 +3374,17 @@ int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, co if (!dir) return -EINVAL; - prefixed = strjoina("# This is a drop-in unit file extension, created via \"systemctl set-property\" or an equivalent operation. Do not edit.\n", - data); + wrapped = strjoina("# This is a drop-in unit file extension, created via \"systemctl set-property\"\n" + "or an equivalent operation. Do not edit.\n", + data, + "\n"); r = drop_in_file(dir, u->id, 50, name, &p, &q); if (r < 0) return r; (void) mkdir_p(p, 0755); - r = write_string_file_atomic_label(q, prefixed); + r = write_string_file_atomic_label(q, wrapped); if (r < 0) return r; |