chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dbus-timer: fix bus_timer_vtable to have the correct times
[elogind.git]
/
src
/
core
/
job.c
diff --git
a/src/core/job.c
b/src/core/job.c
index 93fa44a506a050ceae598d315c76130cddf46dde..0cd4397bf294a6e301954825fe53e2a440eaaa1a 100644
(file)
--- a/
src/core/job.c
+++ b/
src/core/job.c
@@
-610,8
+610,6
@@
_pure_ static const char *job_get_status_message_format_try_harder(Unit *u, JobT
return NULL;
}
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;
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);
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)
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.");
}
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];
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;
if (!format)
return;
+ DISABLE_WARNING_FORMAT_NONLITERAL;
snprintf(buf, sizeof(buf), format, unit_description(u));
char_array_0(buf);
snprintf(buf, sizeof(buf), format, unit_description(u));
char_array_0(buf);
+ REENABLE_WARNING;
if (t == JOB_START) {
sd_id128_t mid;
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);
}
"MESSAGE=%s", buf,
NULL);
}
-#pragma GCC diagnostic pop
int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) {
Unit *u;
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;
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;
if (r < 0)
return r;
@@
-1051,13
+1051,13
@@
int job_coldplug(Job *j) {
assert(j);
assert(j);
- if (j->begin_usec
<
= 0)
+ if (j->begin_usec
== 0 || j->unit->job_timeout =
= 0)
return 0;
if (j->timer_event_source)
j->timer_event_source = sd_event_source_unref(j->timer_event_source);
return 0;
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));
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);
*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;
}
return 1;
}