3d49faeb93
- Add fix-swap-priority: fix default swap priority (bnc#731601). OBS-URL: https://build.opensuse.org/request/show/124228 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=100
37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
Index: systemd-37/src/mount.c
|
|
===================================================================
|
|
--- systemd-37.orig/src/mount.c
|
|
+++ systemd-37/src/mount.c
|
|
@@ -1485,7 +1485,7 @@ fail:
|
|
return r;
|
|
}
|
|
|
|
-static int mount_find_pri(char *options) {
|
|
+static int mount_find_pri(char *options, int *ret) {
|
|
char *end, *pri;
|
|
unsigned long r;
|
|
|
|
@@ -1503,7 +1503,8 @@ static int mount_find_pri(char *options)
|
|
if (end == pri || (*end != ',' && *end != 0))
|
|
return -EINVAL;
|
|
|
|
- return (int) r;
|
|
+ *ret = (int) r;
|
|
+ return 1;
|
|
}
|
|
|
|
static int mount_load_etc_fstab(Manager *m) {
|
|
@@ -1539,9 +1540,10 @@ static int mount_load_etc_fstab(Manager
|
|
path_kill_slashes(where);
|
|
|
|
if (streq(me->mnt_type, "swap")) {
|
|
- int pri;
|
|
+ int r, pri = -1;
|
|
|
|
- if ((pri = mount_find_pri(me->mnt_opts)) < 0)
|
|
+ r = mount_find_pri(me->mnt_opts,&pri);
|
|
+ if (r < 0)
|
|
k = pri;
|
|
else
|
|
k = swap_add_one(m,
|