SHA256
1
0
forked from pool/systemd
systemd/fix-swap-priority.patch
2012-06-10 21:18:43 +00:00

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,