X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmount.c;h=c1048d56495ca5e20a413e8989837f0cfcfc9dd9;hp=660af131dc6312cbaaf891a6df0b99f22da8e893;hb=c375a7f750d0ac3ab130b8d84ebbcbbf32b96c72;hpb=ab5c3e3ff172e7dc295d3022170ee6a3be062a3f diff --git a/src/mount.c b/src/mount.c index 660af131d..c1048d564 100644 --- a/src/mount.c +++ b/src/mount.c @@ -1769,19 +1769,20 @@ static int mount_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError if (who == KILL_MAIN) { dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "Mount units have no main processes"); - return -EINVAL; + return -ESRCH; } if (m->control_pid <= 0 && who == KILL_CONTROL) { dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill"); - return -ENOENT; + return -ESRCH; } - if (m->control_pid > 0) - if (kill(m->control_pid, signo) < 0) - r = -errno; + if (who == KILL_CONTROL || who == KILL_ALL) + if (m->control_pid > 0) + if (kill(m->control_pid, signo) < 0) + r = -errno; - if (mode == KILL_CONTROL_GROUP) { + if (who == KILL_ALL && mode == KILL_CONTROL_GROUP) { int q; if (!(pid_set = set_new(trivial_hash_func, trivial_compare_func))) @@ -1795,7 +1796,7 @@ static int mount_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError } if ((q = cgroup_bonding_kill_list(m->meta.cgroup_bondings, signo, false, pid_set)) < 0) - if (r != -EAGAIN && r != -ESRCH && r != -ENOENT) + if (q != -EAGAIN && q != -ESRCH && q != -ENOENT) r = q; } @@ -1834,6 +1835,10 @@ DEFINE_STRING_TABLE_LOOKUP(mount_exec_command, MountExecCommand); const UnitVTable mount_vtable = { .suffix = ".mount", + .sections = + "Unit\0" + "Mount\0" + "Install\0", .no_alias = true, .no_instances = true,