1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-25 23:21:33 +03:00

Merge pull request #993 from xnox/timedate

timedatectl: assert timezone is not null in setenv() call.
This commit is contained in:
Daniel Mack 2015-08-19 13:56:27 +02:00
commit 9a8e6b0214

View File

@ -96,7 +96,7 @@ static void print_status_info(const StatusInfo *i) {
old_tz = strdupa(tz);
/* Set the new $TZ */
if (setenv("TZ", i->timezone, true) < 0)
if (i->timezone && setenv("TZ", i->timezone, true) < 0)
log_warning_errno(errno, "Failed to set TZ environment variable, ignoring: %m");
else
tzset();