summaryrefslogtreecommitdiffstats
path: root/src/firstboot
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-05-12 21:20:13 +0200
committerMike Gilbert <floppym@gentoo.org>2018-05-12 21:20:13 +0200
commit089fb8653f70b1915ca9ab80ca0ebba1f0cd8185 (patch)
tree280c8acd30eabe0efe4a6b038e3c10860780a846 /src/firstboot
parentbasic: timezone_is_valid: check for magic bytes "TZif" (diff)
downloadsystemd-089fb8653f70b1915ca9ab80ca0ebba1f0cd8185.tar.xz
systemd-089fb8653f70b1915ca9ab80ca0ebba1f0cd8185.zip
basic: add log_level argument to timezone_is_valid
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index ce37339307..7895e3832a 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -364,6 +364,10 @@ static int process_keymap(void) {
return 0;
}
+static bool timezone_is_valid_log_error(const char *name) {
+ return timezone_is_valid(name, LOG_ERR);
+}
+
static int prompt_timezone(void) {
_cleanup_strv_free_ char **zones = NULL;
int r;
@@ -387,7 +391,7 @@ static int prompt_timezone(void) {
putchar('\n');
- r = prompt_loop("Please enter timezone name or number", zones, timezone_is_valid, &arg_timezone);
+ r = prompt_loop("Please enter timezone name or number", zones, timezone_is_valid_log_error, &arg_timezone);
if (r < 0)
return r;
@@ -827,7 +831,7 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_TIMEZONE:
- if (!timezone_is_valid(optarg)) {
+ if (!timezone_is_valid(optarg, LOG_ERR)) {
log_error("Timezone %s is not valid.", optarg);
return -EINVAL;
}