]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
edit-util: add DROPIN_MARKER_{START,END}
authorMike Yuan <me@yhndnzj.com>
Wed, 5 Apr 2023 08:48:27 +0000 (16:48 +0800)
committerMike Yuan <me@yhndnzj.com>
Fri, 7 Apr 2023 08:10:54 +0000 (16:10 +0800)
src/shared/edit-util.h
src/systemctl/systemctl-edit.c

index 63c6190ef84607015530ab9dc86503b998276bf8..e57ca80a4921dd198a1ecf1e1401c2d64334b8b6 100644 (file)
@@ -3,6 +3,9 @@
 
 #include <stdbool.h>
 
+#define DROPIN_MARKER_START "### Anything between here and the comment below will become the contents of the drop-in file"
+#define DROPIN_MARKER_END "### Edits below this comment will be discarded"
+
 typedef struct EditFile EditFile;
 typedef struct EditFileContext EditFileContext;
 
index 5f42dc239ff958e93a4108c55d670bce97c949ae..ff16b73229674a84b0d7043dcb39b357ecd3bdcd 100644 (file)
@@ -13,9 +13,6 @@
 #include "systemctl.h"
 #include "terminal-util.h"
 
-#define EDIT_MARKER_START "### Anything between here and the comment below will become the contents of the drop-in file"
-#define EDIT_MARKER_END "### Edits below this comment will be discarded"
-
 int verb_cat(int argc, char *argv[], void *userdata) {
         _cleanup_(hashmap_freep) Hashmap *cached_name_map = NULL, *cached_id_map = NULL;
         _cleanup_(lookup_paths_free) LookupPaths lp = {};
@@ -316,8 +313,8 @@ static int find_paths_to_edit(
 
 int verb_edit(int argc, char *argv[], void *userdata) {
         _cleanup_(edit_file_context_done) EditFileContext context = {
-                .marker_start = EDIT_MARKER_START,
-                .marker_end = EDIT_MARKER_END,
+                .marker_start = DROPIN_MARKER_START,
+                .marker_end = DROPIN_MARKER_END,
                 .remove_parent = !arg_full,
         };
         _cleanup_(lookup_paths_free) LookupPaths lp = {};