diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-02-19 17:49:00 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-02-19 17:53:50 +0100 |
commit | 1756a0118ea1ab25fd46c853e89853c7e4b3038c (patch) | |
tree | adf675c84e393e6720d704959c49e2c159231bb3 /src/core | |
parent | 39883f622f392d8579f4428fc5a789a102efbb10 (diff) |
execute: modernizations
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/execute.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index 8bfe186c8a..f8b7521ff9 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1977,27 +1977,20 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { fprintf(f, "%s%s: %llu\n", prefix, rlimit_to_string(i), (unsigned long long) c->rlimit[i]->rlim_max); if (c->ioprio_set) { - char *class_str; - int r; + _cleanup_free_ char *class_str = NULL; - r = ioprio_class_to_string_alloc(IOPRIO_PRIO_CLASS(c->ioprio), &class_str); - if (r < 0) - class_str = NULL; + ioprio_class_to_string_alloc(IOPRIO_PRIO_CLASS(c->ioprio), &class_str); fprintf(f, "%sIOSchedulingClass: %s\n" "%sIOPriority: %i\n", prefix, strna(class_str), prefix, (int) IOPRIO_PRIO_DATA(c->ioprio)); - free(class_str); } if (c->cpu_sched_set) { - char *policy_str; - int r; + _cleanup_free_ char *policy_str = NULL; - r = sched_policy_to_string_alloc(c->cpu_sched_policy, &policy_str); - if (r < 0) - policy_str = NULL; + sched_policy_to_string_alloc(c->cpu_sched_policy, &policy_str); fprintf(f, "%sCPUSchedulingPolicy: %s\n" "%sCPUSchedulingPriority: %i\n" @@ -2005,7 +1998,6 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { prefix, strna(policy_str), prefix, c->cpu_sched_priority, prefix, yes_no(c->cpu_sched_reset_on_fork)); - free(policy_str); } if (c->cpuset) { |