core: do not ignore returned values

This commit is contained in:
Yu Watanabe 2017-08-06 23:34:55 +09:00
parent 70d54d9072
commit 837df14040

View file

@ -3524,23 +3524,23 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
if (c->ioprio_set) { if (c->ioprio_set) {
_cleanup_free_ char *class_str = NULL; _cleanup_free_ char *class_str = NULL;
ioprio_class_to_string_alloc(IOPRIO_PRIO_CLASS(c->ioprio), &class_str); r = ioprio_class_to_string_alloc(IOPRIO_PRIO_CLASS(c->ioprio), &class_str);
fprintf(f, if (r >= 0)
"%sIOSchedulingClass: %s\n" fprintf(f, "%sIOSchedulingClass: %s\n", prefix, class_str);
"%sIOPriority: %i\n",
prefix, strna(class_str), fprintf(f, "%sIOPriority: %lu\n", prefix, IOPRIO_PRIO_DATA(c->ioprio));
prefix, (int) IOPRIO_PRIO_DATA(c->ioprio));
} }
if (c->cpu_sched_set) { if (c->cpu_sched_set) {
_cleanup_free_ char *policy_str = NULL; _cleanup_free_ char *policy_str = NULL;
sched_policy_to_string_alloc(c->cpu_sched_policy, &policy_str); r = sched_policy_to_string_alloc(c->cpu_sched_policy, &policy_str);
if (r >= 0)
fprintf(f, "%sCPUSchedulingPolicy: %s\n", prefix, policy_str);
fprintf(f, fprintf(f,
"%sCPUSchedulingPolicy: %s\n"
"%sCPUSchedulingPriority: %i\n" "%sCPUSchedulingPriority: %i\n"
"%sCPUSchedulingResetOnFork: %s\n", "%sCPUSchedulingResetOnFork: %s\n",
prefix, strna(policy_str),
prefix, c->cpu_sched_priority, prefix, c->cpu_sched_priority,
prefix, yes_no(c->cpu_sched_reset_on_fork)); prefix, yes_no(c->cpu_sched_reset_on_fork));
} }
@ -3590,14 +3590,13 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
_cleanup_free_ char *fac_str = NULL, *lvl_str = NULL; _cleanup_free_ char *fac_str = NULL, *lvl_str = NULL;
log_facility_unshifted_to_string_alloc(c->syslog_priority >> 3, &fac_str); r = log_facility_unshifted_to_string_alloc(c->syslog_priority >> 3, &fac_str);
log_level_to_string_alloc(LOG_PRI(c->syslog_priority), &lvl_str); if (r >= 0)
fprintf(f, "%sSyslogFacility: %s\n", prefix, fac_str);
fprintf(f, r = log_level_to_string_alloc(LOG_PRI(c->syslog_priority), &lvl_str);
"%sSyslogFacility: %s\n" if (r >= 0)
"%sSyslogLevel: %s\n", fprintf(f, "%sSyslogLevel: %s\n", prefix, lvl_str);
prefix, strna(fac_str),
prefix, strna(lvl_str));
} }
if (c->secure_bits) if (c->secure_bits)