From: Yu Watanabe Date: Fri, 22 Jan 2021 02:28:06 +0000 (+0900) Subject: hostnamectl: unset pretty hostname only when no target is specified X-Git-Tag: v248-rc1~182^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c388618ec03aceb3c8d4dca75b639f876f28dd99;p=thirdparty%2Fsystemd.git hostnamectl: unset pretty hostname only when no target is specified --- diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index aaba1deacd4..b97411c42bf 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -267,7 +267,7 @@ static int set_hostname(int argc, char **argv, void *userdata) { /* If the passed hostname is already valid, then assume the user doesn't know anything about pretty * hostnames, so let's unset the pretty hostname, and just set the passed hostname as static/dynamic * hostname. */ - if (arg_static && hostname_is_valid(hostname, VALID_HOSTNAME_TRAILING_DOT)) + if (implicit && hostname_is_valid(hostname, VALID_HOSTNAME_TRAILING_DOT)) p = ""; /* No pretty hostname (as it is redundant), just a static one */ else p = hostname; /* Use the passed name as pretty hostname */