From: Yu Watanabe Date: Tue, 17 Apr 2018 05:05:27 +0000 (+0900) Subject: timedate: use sd_bus_error_set() if nothing is substituted X-Git-Tag: v239~384^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e9e5ea880ae2256e36faf092ad72564facce025e;p=thirdparty%2Fsystemd.git timedate: use sd_bus_error_set() if nothing is substituted --- diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index d596de84f72..b53bb5e49c7 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -507,7 +507,7 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro assert(c); if (c->use_ntp) - return sd_bus_error_setf(error, BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, "Automatic time synchronization is enabled"); + return sd_bus_error_set(error, BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, "Automatic time synchronization is enabled"); /* this only gets used if dbus does not provide a timestamp */ start = now(CLOCK_MONOTONIC); @@ -517,7 +517,7 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro return r; if (!relative && utc <= 0) - return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid absolute time"); + return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid absolute time"); if (relative && utc == 0) return sd_bus_reply_method_return(m, NULL); @@ -530,7 +530,7 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro if ((utc > 0 && x < n) || (utc < 0 && x > n)) - return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Time value overflow"); + return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Time value overflow"); timespec_store(&ts, x); } else