various: correct laccess() error check

laccess is our own macro that uses RET_NERRNO.
This commit is contained in:
Mike Yuan
2024-10-04 21:26:04 +02:00
parent 598bb6fde4
commit 7c1dd9e288
10 changed files with 54 additions and 48 deletions
+3 -5
View File
@@ -1111,12 +1111,10 @@ static int kernel_from_version(const char *version, char **ret_kernel) {
return log_oom();
r = laccess(vmlinuz, F_OK);
if (r < 0) {
if (r == -ENOENT)
return log_error_errno(r, "Kernel image not installed to '%s', requiring manual kernel image path specification.", vmlinuz);
if (r == -ENOENT)
return log_error_errno(r, "Kernel image not installed to '%s', requiring manual kernel image path specification.", vmlinuz);
if (r < 0)
return log_error_errno(r, "Failed to determine if kernel image is installed to '%s': %m", vmlinuz);
}
*ret_kernel = TAKE_PTR(vmlinuz);
return 0;