if (!timezone_is_valid(z, LOG_DEBUG))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid time zone '%s'", z);
- r = free_and_strdup(&c->zone, z);
- if (r < 0)
- return r;
- if (r == 0)
+ if (streq_ptr(z, c->zone))
return sd_bus_reply_method_return(m, NULL);
r = bus_verify_polkit_async(
if (r == 0)
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
+ r = free_and_strdup(&c->zone, z);
+ if (r < 0)
+ return r;
+
/* 1. Write new configuration file */
r = context_write_data_timezone(c);
if (r < 0) {