]> git.pld-linux.org Git - packages/util-linux.git/blame - util-linux-swaponsymlink.patch
- login pam: do not log about missing pam_ck_connector.so
[packages/util-linux.git] / util-linux-swaponsymlink.patch
CommitLineData
f212f39a 1When swap is a symlink, the swap entry in
2/etc/fstab may not match /proc/swaps. That
3means strcmp shouldn't be used for swapon.
4
a7980c08
ER
5--- util-linux-2.12p/sys-utils/swapon.c.sopwith Wed Dec 22 04:50:19 2004
6+++ util-linux-2.12p/sys-utils/swapon.c Thu Dec 23 14:44:49 2004
f212f39a 7@@ -138,9 +138,19 @@
8 is_in_proc_swaps(const char *fname) {
9 int i;
10
11- for (i = 0; i < numSwaps; i++)
12- if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
13+ for (i = 0; i < numSwaps; i++) {
14+ struct stat swapped, swapping;
15+
16+ if (!swapFiles[i]) continue;
17+
18+ if (!strcmp(fname, swapFiles[i])
19+ || (!stat (swapFiles[i], &swapped)
20+ && !stat (fname, &swapping)
21+ && (swapped.st_dev == swapping.st_dev
22+ && swapped.st_ino == swapping.st_ino))
23+ )
24 return 1;
25+ }
26 return 0;
27 }
28
This page took 0.027143 seconds and 4 git commands to generate.