if (r < 0)
return log_error_errno(r, "Failed to attach bus to event loop: %m");
+ /* Did we get a timezone or transient hostname from DHCP while D-Bus wasn't up yet? */
+ if (m->dynamic_hostname) {
+ r = manager_set_hostname(m, m->dynamic_hostname);
+ if (r < 0)
+ return r;
+ }
+ if (m->dynamic_timezone) {
+ r = manager_set_timezone(m, m->dynamic_timezone);
+ if (r < 0)
+ return r;
+ }
+
return 0;
}
sd_bus_slot_unref(m->prepare_for_sleep_slot);
sd_event_source_unref(m->bus_retry_event_source);
+ free(m->dynamic_timezone);
+ free(m->dynamic_hostname);
+
free(m);
}
int r;
log_debug("Setting transient hostname: '%s'", strna(hostname));
+ if (free_and_strdup(&m->dynamic_hostname, hostname) < 0)
+ return log_oom();
if (!m->bus) {
/* TODO: replace by assert when we can rely on kdbus */
assert(tz);
log_debug("Setting system timezone: '%s'", tz);
+ if (free_and_strdup(&m->dynamic_timezone, tz) < 0)
+ return log_oom();
if (!m->bus) {
log_info("Not connected to system bus, ignoring timezone.");
usec_t network_dirs_ts_usec;
DUID duid;
+ char* dynamic_hostname;
+ char* dynamic_timezone;
};
static inline const DUID* link_duid(const Link *link) {