Use "return log_error_errno" in more places"
This commit is contained in:
@@ -119,10 +119,8 @@ static int seccomp_add_default_syscall_filter(scmp_filter_ctx ctx,
|
||||
r = seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), blacklist[i].syscall_num, 0);
|
||||
if (r == -EFAULT)
|
||||
continue; /* unknown syscall */
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to block syscall: %m");
|
||||
return r;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to block syscall: %m");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -124,14 +124,12 @@ int change_uid_gid(const char *user, char **_home) {
|
||||
fd = -1;
|
||||
|
||||
if (!fgets(line, sizeof(line), f)) {
|
||||
|
||||
if (!ferror(f)) {
|
||||
log_error("Failed to resolve user %s.", user);
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
log_error_errno(errno, "Failed to read from getent: %m");
|
||||
return -errno;
|
||||
return log_error_errno(errno, "Failed to read from getent: %m");
|
||||
}
|
||||
|
||||
truncate_nl(line);
|
||||
@@ -214,8 +212,7 @@ int change_uid_gid(const char *user, char **_home) {
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
log_error_errno(errno, "Failed to read from getent: %m");
|
||||
return -errno;
|
||||
return log_error_errno(errno, "Failed to read from getent: %m");
|
||||
}
|
||||
|
||||
truncate_nl(line);
|
||||
|
||||
Reference in New Issue
Block a user