From 25300b5a1fcf54674a69d0f4ab08925be00b0227 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 23 Aug 2015 14:30:52 +0200 Subject: util: make machine_name_is_valid() a macro and move it to hostname-util.h As it turns out machine_name_is_valid() does the exact same thing as hostname_is_valid() these days, as it just invoked that and checked the name length was < 64. However, hostname_is_valid() checks the length against HOST_NAME_MAX anyway (which is 64 on Linux), hence any additional check is redundant. We hence replace machine_name_is_valid() by a macro that simply maps it to hostname_is_valid() but sets the allow_trailing_dot parameter to false. We also move this this call to hostname-util.h, to the same place as the hostname_is_valid() declaration. --- src/machine/machinectl.c | 1 + src/machine/machined-dbus.c | 1 + src/machine/machined.c | 1 + 3 files changed, 3 insertions(+) (limited to 'src/machine') diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 8e75508444..72b9a619d2 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -56,6 +56,7 @@ #include "terminal-util.h" #include "signal-util.h" #include "env-util.h" +#include "hostname-util.h" static char **arg_property = NULL; static bool arg_all = false; diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index 93514986f3..03625ba4cd 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -33,6 +33,7 @@ #include "btrfs-util.h" #include "formats-util.h" #include "process-util.h" +#include "hostname-util.h" #include "machine-image.h" #include "machine-pool.h" #include "image-dbus.h" diff --git a/src/machine/machined.c b/src/machine/machined.c index c8ad157326..109bab76c5 100644 --- a/src/machine/machined.c +++ b/src/machine/machined.c @@ -30,6 +30,7 @@ #include "label.h" #include "formats-util.h" #include "signal-util.h" +#include "hostname-util.h" #include "machine-image.h" #include "machined.h" -- cgit v1.2.3-54-g00ecf