]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/unit-printf.c
tree-wide: use "hostname" spelling everywhere
[thirdparty/systemd.git] / src / core / unit-printf.c
index 72391ace3a95c19e5b10b1ccd945581b2e8a30de..7507479ce27cdd61a36377c482403da2f1648020 100644 (file)
@@ -171,7 +171,7 @@ static int specifier_special_directory(char specifier, const void *data, const v
         return 0;
 }
 
-int unit_name_printf(Unit *u, const char* format, char **ret) {
+int unit_name_printf(const Unit *u, const char* format, char **ret) {
 
         /*
          * This will use the passed string as format string and replace the following specifiers (which should all be
@@ -186,7 +186,7 @@ int unit_name_printf(Unit *u, const char* format, char **ret) {
          * %u: the username of the running user
          *
          * %m: the machine ID of the running system
-         * %H: the host name of the running system
+         * %H: the hostname of the running system
          * %b: the boot ID of the running system
          */
 
@@ -215,8 +215,7 @@ int unit_name_printf(Unit *u, const char* format, char **ret) {
         return specifier_printf(format, table, u, ret);
 }
 
-int unit_full_printf(Unit *u, const char *format, char **ret) {
-
+int unit_full_printf(const Unit *u, const char *format, char **ret) {
         /* This is similar to unit_name_printf() but also supports unescaping. Also, adds a couple of additional codes
          * (which are likely not suitable for unescaped inclusion in unit names):
          *
@@ -244,6 +243,10 @@ int unit_full_printf(Unit *u, const char *format, char **ret) {
          * before or after the relevant configuration setting. Hence: don't add them.
          */
 
+        assert(u);
+        assert(format);
+        assert(ret);
+
         const Specifier table[] = {
                 { 'n', specifier_string,                   u->id },
                 { 'N', specifier_prefix_and_instance,      NULL },
@@ -281,9 +284,5 @@ int unit_full_printf(Unit *u, const char *format, char **ret) {
                 {}
         };
 
-        assert(u);
-        assert(format);
-        assert(ret);
-
         return specifier_printf(format, table, u, ret);
 }