summaryrefslogtreecommitdiffstats
path: root/src/core/automount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-17 20:15:26 +0200
committerLennart Poettering <lennart@poettering.net>2018-10-26 10:40:01 +0200
commita2a444440f0c3090c375a81a038adfc7cc70ff40 (patch)
treeb1c9114c6457881587291fa5fe2414aebb072cec /src/core/automount.c
parentcore: enforce a limit on STATUS= texts recvd from services (diff)
downloadsystemd-a2a444440f0c3090c375a81a038adfc7cc70ff40.tar.xz
systemd-a2a444440f0c3090c375a81a038adfc7cc70ff40.zip
automount: fix deserialization of dev_t
let's prefer "unsigned long" rather than "unsigned", in case there are archs that have 32bit int, but 64bit dev_t. (Also one cast was wrong anyway.)
Diffstat (limited to 'src/core/automount.c')
-rw-r--r--src/core/automount.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index 70232f358d..eebcc3b20b 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -882,12 +882,13 @@ static int automount_deserialize_item(Unit *u, const char *key, const char *valu
a->result = f;
} else if (streq(key, "dev-id")) {
- unsigned d;
+ unsigned long d;
- if (safe_atou(value, &d) < 0)
+ if (safe_atolu(value, &d) < 0)
log_unit_debug(u, "Failed to parse dev-id value: %s", value);
else
- a->dev_id = (unsigned) d;
+ a->dev_id = (dev_t) d;
+
} else if (streq(key, "token")) {
unsigned token;