diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-04-11 13:50:08 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-04-11 21:02:34 +0200 |
commit | 9a5893e9bbb86b4939ce6c4047fc4636329f5e7e (patch) | |
tree | 756ff52d17c6bcc41cd20181a777cae0db5e8c0e /src | |
parent | test-unit-name: add missing tests for specifiers, fix existing tests (diff) | |
download | systemd-9a5893e9bbb86b4939ce6c4047fc4636329f5e7e.tar.xz systemd-9a5893e9bbb86b4939ce6c4047fc4636329f5e7e.zip |
tree-wide: host_name → hostname
We use "hostname" exclusively in docs, and also in a big majority of the
code. Let's use the same spelling in remaining places.
Diffstat (limited to 'src')
-rw-r--r-- | src/resolve/resolved-conf.c | 2 | ||||
-rw-r--r-- | src/resolve/resolved-dnssd.c | 20 | ||||
-rw-r--r-- | src/shared/specifier.c | 6 | ||||
-rw-r--r-- | src/shared/specifier.h | 50 | ||||
-rw-r--r-- | src/test/test-unit-name.c | 4 | ||||
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 4 |
6 files changed, 43 insertions, 43 deletions
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c index 930313b844..a25dffae63 100644 --- a/src/resolve/resolved-conf.c +++ b/src/resolve/resolved-conf.c @@ -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 }, diff --git a/src/resolve/resolved-dnssd.c b/src/resolve/resolved-dnssd.c index 6d77aa817e..443760ab70 100644 --- a/src/resolve/resolved-dnssd.c +++ b/src/resolve/resolved-dnssd.c @@ -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; diff --git a/src/shared/specifier.c b/src/shared/specifier.c index 87b99d38bc..0742fae39e 100644 --- a/src/shared/specifier.c +++ b/src/shared/specifier.c @@ -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); diff --git a/src/shared/specifier.h b/src/shared/specifier.h index ea37e3cef6..abde3d9ad2 100644 --- a/src/shared/specifier.h +++ b/src/shared/specifier.h @@ -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, "%", "%%"); diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c index c00c1fe79a..4c43f00881 100644 --- a/src/test/test-unit-name.c +++ b/src/test/test-unit-name.c @@ -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); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 023207bc60..4d9907e424 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -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 }, |