X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fdbus-execute.c;h=2a8a0e1ac58610a31564959b21a8ee4756fae3ec;hb=e2acb67baaa1d63685dcaf80becf10291f13d086;hp=e815cb58e4817a23bb01bd2362be25b1f40b9945;hpb=4819ff0358b6317c195fd4b1768e03d09c871070;p=elogind.git diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index e815cb58e..2a8a0e1ac 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -29,6 +29,7 @@ #include "strv.h" #include "dbus-common.h" #include "syscall-list.h" +#include "fileio.h" DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_execute_append_input, exec_input, ExecInput); DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_execute_append_output, exec_output, ExecOutput); @@ -159,12 +160,12 @@ int bus_execute_append_cpu_sched_priority(DBusMessageIter *i, const char *proper if (c->cpu_sched_set) n = c->cpu_sched_priority; else { - struct sched_param p; - n = 0; + struct sched_param p = {}; - zero(p); if (sched_getparam(0, &p) >= 0) n = p.sched_priority; + else + n = 0; } if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT32, &n)) @@ -278,9 +279,8 @@ int bus_execute_append_rlimits(DBusMessageIter *i, const char *property, void *d if (c->rlimit[r]) u = (uint64_t) c->rlimit[r]->rlim_max; else { - struct rlimit rl; + struct rlimit rl = {}; - zero(rl); getrlimit(r, &rl); u = (uint64_t) rl.rlim_max;