1
0
mirror of https://github.com/systemd/systemd synced 2026-03-29 19:24:50 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Luca Boccassi
9d0ad242b8 man/glib-event-glue example: relicense to CC0-1.0
All other examples were relicensed to CC0-1.0 since they are intended
to be copied and pasted anywhere without any restrictions.
Relicense the last one too.
2021-10-04 11:05:22 +02:00
Egor
936a7cb66a sleep: don't skip resume device with low priority/available space
this fixes hibernation when there's a higher priority swap preceding
the resume swap in /proc/swaps.

fixes #19486
2021-10-04 10:23:42 +02:00
3 changed files with 12 additions and 11 deletions

View File

@ -39,7 +39,6 @@ The following exceptions apply:
* the following sources are licensed under the **MIT** license (in case of our
scripts, to facilitate copying and reuse of those helpers to other projects):
- hwdb.d/parse_hwdb.py
- man/glib-event-glue.c
- src/basic/linux/batman_adv.h
- src/basic/sparse-endian.h
- tools/catalog-report.py

View File

@ -1,4 +1,4 @@
/* SPDX-License-Identifier: MIT */
/* SPDX-License-Identifier: CC0-1.0 */
#include <stdlib.h>
#include <glib.h>

View File

@ -392,6 +392,7 @@ int find_hibernate_location(HibernateLocation **ret_hibernate_location) {
}
/* prefer resume device or highest priority swap with most remaining space */
if (sys_resume == 0) {
if (hibernate_location && swap->priority < hibernate_location->swap->priority) {
log_debug("%s: ignoring device with lower priority", swap->device);
continue;
@ -402,6 +403,7 @@ int find_hibernate_location(HibernateLocation **ret_hibernate_location) {
log_debug("%s: ignoring device with lower usable space", swap->device);
continue;
}
}
dev_t swap_device;
r = swap_device_to_device_id(swap, &swap_device);