]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-swaponsymlink.patch
- login pam: do not log about missing pam_ck_connector.so
[packages/util-linux.git] / util-linux-swaponsymlink.patch
1 When swap is a symlink, the swap entry in
2 /etc/fstab may not match /proc/swaps. That
3 means strcmp shouldn't be used for swapon.
4
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
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.030523 seconds and 3 git commands to generate.