]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/import/pull-tar.c
util: make machine_name_is_valid() a macro and move it to hostname-util.h
authorLennart Poettering <lennart@poettering.net>
Sun, 23 Aug 2015 12:30:52 +0000 (14:30 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Aug 2015 20:46:45 +0000 (22:46 +0200)
commit25300b5a1fcf54674a69d0f4ab08925be00b0227
treea29da7b64948e59d558fe4051893e1161e2df4e6
parentb59abc4d1e5c8e99323f404ef4a09bd6da68064f
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.
19 files changed:
src/basic/hostname-util.h
src/basic/util.c
src/basic/util.h
src/import/export.c
src/import/import-raw.c
src/import/import-tar.c
src/import/import.c
src/import/importd.c
src/import/pull-raw.c
src/import/pull-tar.c
src/import/pull.c
src/journal/sd-journal.c
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-login/sd-login.c
src/machine/machinectl.c
src/machine/machined-dbus.c
src/machine/machined.c
src/nss-mymachines/nss-mymachines.c
src/shared/logs-show.c