chiark / gitweb /
dbus-timer: fix bus_timer_vtable to have the correct times
[elogind.git] / src / core / job.c
index 941f9560258518f493f71c73c896947d1a22ea47..0cd4397bf294a6e301954825fe53e2a440eaaa1a 100644 (file)
@@ -610,8 +610,6 @@ _pure_ static const char *job_get_status_message_format_try_harder(Unit *u, JobT
         return NULL;
 }
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 static void job_print_status_message(Unit *u, JobType t, JobResult result) {
         const char *format;
 
@@ -619,6 +617,8 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
         assert(t >= 0);
         assert(t < _JOB_TYPE_MAX);
 
+        DISABLE_WARNING_FORMAT_NONLITERAL;
+
         if (t == JOB_START) {
                 format = job_get_status_message_format(u, t, result);
                 if (!format)
@@ -681,11 +681,10 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
                 if (result == JOB_SKIPPED)
                         unit_status_printf(u, ANSI_HIGHLIGHT_ON " INFO " ANSI_HIGHLIGHT_OFF, "%s is not active.");
         }
+
+        REENABLE_WARNING;
 }
-#pragma GCC diagnostic pop
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 static void job_log_status_message(Unit *u, JobType t, JobResult result) {
         const char *format;
         char buf[LINE_MAX];
@@ -704,8 +703,10 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) {
         if (!format)
                 return;
 
+        DISABLE_WARNING_FORMAT_NONLITERAL;
         snprintf(buf, sizeof(buf), format, unit_description(u));
         char_array_0(buf);
+        REENABLE_WARNING;
 
         if (t == JOB_START) {
                 sd_id128_t mid;
@@ -734,7 +735,6 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) {
                            "MESSAGE=%s", buf,
                            NULL);
 }
-#pragma GCC diagnostic pop
 
 int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) {
         Unit *u;
@@ -872,7 +872,7 @@ int job_start_timer(Job *j) {
         if (j->unit->job_timeout <= 0)
                 return 0;
 
-        r = sd_event_add_monotonic(j->manager->event, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j, &j->timer_event_source);
+        r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j);
         if (r < 0)
                 return r;
 
@@ -1057,7 +1057,7 @@ int job_coldplug(Job *j) {
         if (j->timer_event_source)
                 j->timer_event_source = sd_event_source_unref(j->timer_event_source);
 
-        r = sd_event_add_monotonic(j->manager->event, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j, &j->timer_event_source);
+        r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j);
         if (r < 0)
                 log_debug("Failed to restart timeout for job: %s", strerror(-r));
 
@@ -1118,9 +1118,6 @@ int job_get_timeout(Job *j, uint64_t *timeout) {
 
         *timeout = MIN(x, y);
 
-        log_info("job_get_timeout %s %d/%"PRIu64" %d/%"PRIu64" -> 1/%"PRIu64,
-                 j->unit->id, r, x, q, y, *timeout);
-
         return 1;
 }