summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-23 14:30:52 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-24 22:46:45 +0200
commit25300b5a1fcf54674a69d0f4ab08925be00b0227 (patch)
treea29da7b64948e59d558fe4051893e1161e2df4e6 /src/libsystemd
parentb59abc4d1e5c8e99323f404ef4a09bd6da68064f (diff)
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.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c1
-rw-r--r--src/libsystemd/sd-login/sd-login.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index db4f21e9ff..31cdcb4e5b 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -33,6 +33,7 @@
#include "missing.h"
#include "def.h"
#include "cgroup-util.h"
+#include "hostname-util.h"
#include "bus-label.h"
#include "sd-bus.h"
diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c
index 9bbf8974dd..5f290573cb 100644
--- a/src/libsystemd/sd-login/sd-login.c
+++ b/src/libsystemd/sd-login/sd-login.c
@@ -32,6 +32,7 @@
#include "fileio.h"
#include "login-util.h"
#include "formats-util.h"
+#include "hostname-util.h"
#include "sd-login.h"
_public_ int sd_pid_get_session(pid_t pid, char **session) {