X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmount.c;h=94f19294fdda326728e08fd9a723aa7e4ef98710;hb=d55ae9e6d7a20bb79f60a154bfcf4348dfb06852;hp=4a38e957003d6b8c14cc5d8d0ba6b2f14f13725d;hpb=18c78fb1af5415bb6f87d9c7cae1f9c60e14ae24;p=elogind.git diff --git a/src/mount.c b/src/mount.c index 4a38e9570..94f19294f 100644 --- a/src/mount.c +++ b/src/mount.c @@ -35,6 +35,7 @@ #include "unit-name.h" #include "mount.h" #include "dbus-mount.h" +#include "special.h" static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = { [MOUNT_DEAD] = UNIT_INACTIVE, @@ -839,7 +840,7 @@ static int mount_serialize(Unit *u, FILE *f, FDSet *fds) { unit_serialize_item(u, f, "failure", yes_no(m->failure)); if (m->control_pid > 0) - unit_serialize_item_format(u, f, "control-pid", "%u", (unsigned) m->control_pid); + unit_serialize_item_format(u, f, "control-pid", "%lu", (unsigned long) m->control_pid); if (m->control_command_id >= 0) unit_serialize_item(u, f, "control-command", mount_exec_command_to_string(m->control_command_id)); @@ -872,12 +873,12 @@ static int mount_deserialize_item(Unit *u, const char *key, const char *value, F m->failure = b || m->failure; } else if (streq(key, "control-pid")) { - unsigned pid; + pid_t pid; - if ((r = safe_atou(value, &pid)) < 0 || pid <= 0) + if ((r = parse_pid(value, &pid)) < 0) log_debug("Failed to parse control-pid value %s", value); else - m->control_pid = (pid_t) pid; + m->control_pid = pid; } else if (streq(key, "control-command")) { MountExecCommand id;