diff options
Diffstat (limited to 'src/tmpfiles/tmpfiles.c')
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 4604b2d47b..b6596fd0c7 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1063,7 +1063,7 @@ static int parse_acls_from_arg(Item *item) { if (r < 0) log_warning_errno(r, "Failed to parse ACL \"%s\": %m. Ignoring", item->argument); #else - log_warning_errno(SYNTHETIC_ERRNO(ENOSYS), "ACLs are not supported. Ignoring"); + log_warning("ACLs are not supported. Ignoring."); #endif return 0; @@ -1417,10 +1417,10 @@ static int create_file(Item *i, const char *path) { if (fstat(fd, &stbuf) < 0) return log_error_errno(errno, "stat(%s) failed: %m", path); - if (!S_ISREG(stbuf.st_mode)) { - log_error("%s exists and is not a regular file.", path); - return -EEXIST; - } + if (!S_ISREG(stbuf.st_mode)) + return log_error_errno(SYNTHETIC_ERRNO(EEXIST), + "%s exists and is not a regular file.", + path); st = &stbuf; } else { @@ -1481,10 +1481,10 @@ static int truncate_file(Item *i, const char *path) { fd = openat(dir_fd, bn, O_NOFOLLOW|O_CLOEXEC|O_PATH, i->mode); if (fd < 0) { - if (errno == ENOENT) { - log_error("Cannot create file %s on a read-only file system.", path); - return -EROFS; - } + if (errno == ENOENT) + return log_error_errno(SYNTHETIC_ERRNO(EROFS), + "Cannot create file %s on a read-only file system.", + path); return log_error_errno(errno, "Failed to re-open file %s: %m", path); } @@ -1495,10 +1495,10 @@ static int truncate_file(Item *i, const char *path) { if (fstat(fd, &stbuf) < 0) return log_error_errno(errno, "stat(%s) failed: %m", path); - if (!S_ISREG(stbuf.st_mode)) { - log_error("%s exists and is not a regular file.", path); - return -EEXIST; - } + if (!S_ISREG(stbuf.st_mode)) + return log_error_errno(SYNTHETIC_ERRNO(EEXIST), + "%s exists and is not a regular file.", + path); if (stbuf.st_size > 0) { if (ftruncate(fd, 0) < 0) { |