chiark / gitweb /
timedated: remove spurious include of <sys/capability.h>
[elogind.git] / src / timedate / timedated.c
index 56df59f9b7a06e1b5f04f9f883fa15580261378a..d507200648426054966b8c136baf30d6c471255d 100644 (file)
@@ -22,7 +22,6 @@
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/capability.h>
 
 #include "sd-id128.h"
 #include "sd-messages.h"
 #include "fileio-label.h"
 #include "label.h"
 #include "bus-util.h"
-#include "bus-errors.h"
+#include "bus-error.h"
+#include "bus-common-errors.h"
 #include "event-util.h"
 
 #define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n"
 #define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
 
-SD_BUS_ERROR_MAPPING(timedated) = {
-        {"org.freedesktop.timedate1.NoNTPSupport", ENOTSUP},
+static BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map timedated_errors[] = {
+        SD_BUS_ERROR_MAP("org.freedesktop.timedate1.NoNTPSupport", ENOTSUP),
+        SD_BUS_ERROR_MAP_END
 };
 
 typedef struct Context {
@@ -569,7 +570,7 @@ static int method_set_time(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bu
 
         /* Set system clock */
         if (clock_settime(CLOCK_REALTIME, &ts) < 0) {
-                log_error("Failed to set local time: %m");
+                log_error_errno(errno, "Failed to set local time: %m");
                 return sd_bus_error_set_errnof(error, errno, "Failed to set local time: %m");
         }