]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: host_name → hostname 23048/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Apr 2022 11:50:08 +0000 (13:50 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Apr 2022 19:02:34 +0000 (21:02 +0200)
We use "hostname" exclusively in docs, and also in a big majority of the
code. Let's use the same spelling in remaining places.

src/resolve/resolved-conf.c
src/resolve/resolved-dnssd.c
src/shared/specifier.c
src/shared/specifier.h
src/test/test-unit-name.c
src/tmpfiles/tmpfiles.c

index 930313b84420513d1eb906ae515e5898be0d81de..a25dffae630ae074c292c8c6bc356a351a02a8c7 100644 (file)
@@ -225,7 +225,7 @@ int config_parse_dnssd_service_name(
                 { 'a', specifier_architecture,    NULL },
                 { 'b', specifier_boot_id,         NULL },
                 { 'B', specifier_os_build_id,     NULL },
-                { 'H', specifier_host_name,       NULL }, /* We will use specifier_dnssd_host_name(). */
+                { 'H', specifier_hostname,        NULL }, /* We will use specifier_dnssd_hostname(). */
                 { 'm', specifier_machine_id,      NULL },
                 { 'o', specifier_os_id,           NULL },
                 { 'v', specifier_kernel_release,  NULL },
index 6d77aa817e41550dce9b9e40744d27b91e3c61ea..443760ab7078fcf95adf290c6ff0aab34ca0e8bf 100644 (file)
@@ -135,7 +135,7 @@ static int dnssd_service_load(Manager *manager, const char *filename) {
         return 0;
 }
 
-static int specifier_dnssd_host_name(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
+static int specifier_dnssd_hostname(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
         DnssdService *s  = (DnssdService *) userdata;
         char *n;
 
@@ -153,15 +153,15 @@ static int specifier_dnssd_host_name(char specifier, const void *data, const cha
 
 int dnssd_render_instance_name(DnssdService *s, char **ret_name) {
         static const Specifier specifier_table[] = {
-                { 'a', specifier_architecture,    NULL },
-                { 'b', specifier_boot_id,         NULL },
-                { 'B', specifier_os_build_id,     NULL },
-                { 'H', specifier_dnssd_host_name, NULL },
-                { 'm', specifier_machine_id,      NULL },
-                { 'o', specifier_os_id,           NULL },
-                { 'v', specifier_kernel_release,  NULL },
-                { 'w', specifier_os_version_id,   NULL },
-                { 'W', specifier_os_variant_id,   NULL },
+                { 'a', specifier_architecture,   NULL },
+                { 'b', specifier_boot_id,        NULL },
+                { 'B', specifier_os_build_id,    NULL },
+                { 'H', specifier_dnssd_hostname, NULL },
+                { 'm', specifier_machine_id,     NULL },
+                { 'o', specifier_os_id,          NULL },
+                { 'v', specifier_kernel_release, NULL },
+                { 'w', specifier_os_version_id,  NULL },
+                { 'W', specifier_os_variant_id,  NULL },
                 {}
         };
         _cleanup_free_ char *name = NULL;
index 87b99d38bc64aefcd0bf21b779cbd83e092b04a7..0742fae39ed67d46226e12a80654d0ffcd571d72 100644 (file)
@@ -199,7 +199,7 @@ int specifier_boot_id(char specifier, const void *data, const char *root, const
         return 0;
 }
 
-int specifier_host_name(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
+int specifier_hostname(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
         char *n;
 
         assert(ret);
@@ -212,7 +212,7 @@ int specifier_host_name(char specifier, const void *data, const char *root, cons
         return 0;
 }
 
-int specifier_short_host_name(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
+int specifier_short_hostname(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
         char *n;
 
         assert(ret);
@@ -225,7 +225,7 @@ int specifier_short_host_name(char specifier, const void *data, const char *root
         return 0;
 }
 
-int specifier_pretty_host_name(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
+int specifier_pretty_hostname(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
         char *n = NULL;
 
         assert(ret);
index ea37e3cef6fec86fcaf89e7bca7be019c32087c3..abde3d9ad2b3738b741015c8d845513e08cf14a2 100644 (file)
@@ -19,9 +19,9 @@ int specifier_real_directory(char specifier, const void *data, const char *root,
 
 int specifier_machine_id(char specifier, const void *data, const char *root, const void *userdata, char **ret);
 int specifier_boot_id(char specifier, const void *data, const char *root, const void *userdata, char **ret);
-int specifier_host_name(char specifier, const void *data, const char *root, const void *userdata, char **ret);
-int specifier_short_host_name(char specifier, const void *data, const char *root, const void *userdata, char **ret);
-int specifier_pretty_host_name(char specifier, const void *data, const char *root, const void *userdata, char **ret);
+int specifier_hostname(char specifier, const void *data, const char *root, const void *userdata, char **ret);
+int specifier_short_hostname(char specifier, const void *data, const char *root, const void *userdata, char **ret);
+int specifier_pretty_hostname(char specifier, const void *data, const char *root, const void *userdata, char **ret);
 int specifier_kernel_release(char specifier, const void *data, const char *root, const void *userdata, char **ret);
 int specifier_architecture(char specifier, const void *data, const char *root, const void *userdata, char **ret);
 int specifier_os_id(char specifier, const void *data, const char *root, const void *userdata, char **ret);
@@ -70,30 +70,30 @@ int specifier_var_tmp_dir(char specifier, const void *data, const char *root, co
  * %V: the temporary directory for large, persistent stuff (e.g. /var/tmp, or $TMPDIR, $TEMP, $TMP)
  */
 
-#define COMMON_SYSTEM_SPECIFIERS                  \
-        { 'a', specifier_architecture,    NULL }, \
-        { 'A', specifier_os_image_version,NULL }, \
-        { 'b', specifier_boot_id,         NULL }, \
-        { 'B', specifier_os_build_id,     NULL }, \
-        { 'H', specifier_host_name,       NULL }, \
-        { 'l', specifier_short_host_name, NULL }, \
-        { 'q', specifier_pretty_host_name,NULL }, \
-        { 'm', specifier_machine_id,      NULL }, \
-        { 'M', specifier_os_image_id,     NULL }, \
-        { 'o', specifier_os_id,           NULL }, \
-        { 'v', specifier_kernel_release,  NULL }, \
-        { 'w', specifier_os_version_id,   NULL }, \
-        { 'W', specifier_os_variant_id,   NULL }
+#define COMMON_SYSTEM_SPECIFIERS                   \
+        { 'a', specifier_architecture,     NULL }, \
+        { 'A', specifier_os_image_version, NULL }, \
+        { 'b', specifier_boot_id,          NULL }, \
+        { 'B', specifier_os_build_id,      NULL }, \
+        { 'H', specifier_hostname,         NULL }, \
+        { 'l', specifier_short_hostname,   NULL }, \
+        { 'q', specifier_pretty_hostname,  NULL }, \
+        { 'm', specifier_machine_id,       NULL }, \
+        { 'M', specifier_os_image_id,      NULL }, \
+        { 'o', specifier_os_id,            NULL }, \
+        { 'v', specifier_kernel_release,   NULL }, \
+        { 'w', specifier_os_version_id,    NULL }, \
+        { 'W', specifier_os_variant_id,    NULL }
 
-#define COMMON_CREDS_SPECIFIERS(scope)                          \
-        { 'g', specifier_group_name,      INT_TO_PTR(scope) },  \
-        { 'G', specifier_group_id,        INT_TO_PTR(scope) },  \
-        { 'u', specifier_user_name,       INT_TO_PTR(scope) },  \
-        { 'U', specifier_user_id,         INT_TO_PTR(scope) }
+#define COMMON_CREDS_SPECIFIERS(scope)                           \
+        { 'g', specifier_group_name,       INT_TO_PTR(scope) },  \
+        { 'G', specifier_group_id,         INT_TO_PTR(scope) },  \
+        { 'u', specifier_user_name,        INT_TO_PTR(scope) },  \
+        { 'U', specifier_user_id,          INT_TO_PTR(scope) }
 
-#define COMMON_TMP_SPECIFIERS                     \
-        { 'T', specifier_tmp_dir,         NULL }, \
-        { 'V', specifier_var_tmp_dir,     NULL }
+#define COMMON_TMP_SPECIFIERS                      \
+        { 'T', specifier_tmp_dir,          NULL }, \
+        { 'V', specifier_var_tmp_dir,      NULL }
 
 static inline char* specifier_escape(const char *string) {
         return strreplace(string, "%", "%%");
index c00c1fe79af0b449376e200f02bdcc21c7f147ee..4c43f00881d6d507adf04454d7429473f140f61e 100644 (file)
@@ -236,9 +236,9 @@ TEST_RET(unit_printf, .sd_booted = true) {
         assert_se(boot_id);
         assert_se(specifier_os_build_id('B', NULL, NULL, NULL, &os_build_id) >= 0);
         assert_se(hostname = gethostname_malloc());
-        assert_se(specifier_short_host_name('l', NULL, NULL, NULL, &short_hostname) == 0);
+        assert_se(specifier_short_hostname('l', NULL, NULL, NULL, &short_hostname) == 0);
         assert_se(short_hostname);
-        assert_se(specifier_pretty_host_name('q', NULL, NULL, NULL, &pretty_hostname) == 0);
+        assert_se(specifier_pretty_hostname('q', NULL, NULL, NULL, &pretty_hostname) == 0);
         assert_se(pretty_hostname);
         assert_se(specifier_machine_id('m', NULL, NULL, NULL, &machine_id) >= 0);
         assert_se(machine_id);
index 023207bc6017ccd1123182a0ba9d7a049d2e85d9..4d9907e4245586e02e0b3ca712fb22d46552b237 100644 (file)
@@ -2923,8 +2923,8 @@ static int parse_line(
                 { 'a', specifier_architecture,    NULL },
                 { 'b', specifier_boot_id,         NULL },
                 { 'B', specifier_os_build_id,     NULL },
-                { 'H', specifier_host_name,       NULL },
-                { 'l', specifier_short_host_name, NULL },
+                { 'H', specifier_hostname,        NULL },
+                { 'l', specifier_short_hostname,  NULL },
                 { 'm', specifier_machine_id_safe, NULL },
                 { 'o', specifier_os_id,           NULL },
                 { 'v', specifier_kernel_release,  NULL },