mirror of
https://github.com/systemd/systemd.git
synced 2026-08-07 16:41:02 +00:00
hibernate-util: report no available swap as no enough swap space
Otherwise, ENOENT or ENXIO may be directly returned as error through bus. Should help to generate clearer error message for #30083.
This commit is contained in:
@@ -349,7 +349,7 @@ int find_suitable_hibernation_device_full(HibernationDevice *ret_device, uint64_
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (entries.n_swaps == 0)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENOENT), "No swap space available for hibernation.");
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENOSPC), "No swap space available for hibernation.");
|
||||
|
||||
FOREACH_ARRAY(swap, entries.swaps, entries.n_swaps) {
|
||||
r = swap_entry_get_resume_config(swap);
|
||||
@@ -385,7 +385,7 @@ int find_suitable_hibernation_device_full(HibernationDevice *ret_device, uint64_
|
||||
if (!entry) {
|
||||
/* No need to check n_swaps == 0, since it's rejected early */
|
||||
assert(resume_config_devno > 0);
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENXIO), "Cannot find swap entry corresponding to /sys/power/resume.");
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENOSPC), "Cannot find swap entry corresponding to /sys/power/resume.");
|
||||
}
|
||||
|
||||
if (ret_device)
|
||||
|
||||
Reference in New Issue
Block a user