summaryrefslogtreecommitdiff
path: root/src/mount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-17 22:55:53 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-17 22:55:53 +0200
commit5925dd3c7ab771c86036b4a91640957e5d7a0e80 (patch)
tree2ecee71e040fdb11dfcdf331190df062f32a28c7 /src/mount.c
parent08bfb8106b3a337ebf9a4bf3a8ddd2e494d18b48 (diff)
service: rework PID parsing logic everywhere
Diffstat (limited to 'src/mount.c')
-rw-r--r--src/mount.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mount.c b/src/mount.c
index 4a38e95700..ea81f5fee6 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -839,7 +839,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 +872,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;