diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-30 10:09:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-30 10:09:00 +0100 |
commit | b2ac2b01c8ddaabbe63bcb7168dd752f44320d86 (patch) | |
tree | 91b74d45e81f52ee09019fa33e92ab926eac2f5d /src/tmpfiles/tmpfiles.c | |
parent | 00195abcbeeba5c8b87b35c3626e9f9ed8b48d9c (diff) | |
parent | 8f2eb7302dc98794247d49c85d8a366d89218aee (diff) | |
download | systemd-b2ac2b01c8ddaabbe63bcb7168dd752f44320d86.tar.gz |
Merge pull request #10996 from poettering/oci-prep
Preparation for the nspawn-OCI work
Diffstat (limited to 'src/tmpfiles/tmpfiles.c')
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index e31af282a4..21ba6dd330 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -2636,24 +2636,21 @@ static int parse_line(const char *fname, unsigned line, const char *buffer, bool break; case CREATE_CHAR_DEVICE: - case CREATE_BLOCK_DEVICE: { - unsigned major, minor; - + case CREATE_BLOCK_DEVICE: if (!i.argument) { *invalid_config = true; log_error("[%s:%u] Device file requires argument.", fname, line); return -EBADMSG; } - if (sscanf(i.argument, "%u:%u", &major, &minor) != 2) { + r = parse_dev(i.argument, &i.major_minor); + if (r < 0) { *invalid_config = true; - log_error("[%s:%u] Can't parse device file major/minor '%s'.", fname, line, i.argument); + log_error_errno(r, "[%s:%u] Can't parse device file major/minor '%s'.", fname, line, i.argument); return -EBADMSG; } - i.major_minor = makedev(major, minor); break; - } case SET_XATTR: case RECURSIVE_SET_XATTR: |