util: unify how we parse mode_t strings

This commit is contained in:
Lennart Poettering
2015-04-10 16:23:46 +02:00
parent 6dd67163b8
commit 2ff7b0a542
5 changed files with 52 additions and 25 deletions
+2 -2
View File
@@ -1879,9 +1879,9 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
mm++;
}
if (sscanf(mm, "%o", &m) != 1) {
if (parse_mode(mm, &m) < 0) {
log_error("[%s:%u] Invalid mode '%s'.", fname, line, mode);
return -ENOENT;
return -EBADMSG;
}
i.mode = m;