Blame util-linux-2.12p-swaponsymlink-57300.patch
|
Elliot Lee |
be1f689 |
--- util-linux-2.12p/mount/swapon.c.sopwith Wed Dec 22 04:50:19 2004
|
|
Elliot Lee |
be1f689 |
+++ util-linux-2.12p/mount/swapon.c Thu Dec 23 14:44:49 2004
|
|
Elliot Lee |
be1f689 |
@@ -138,9 +138,19 @@
|
|
Elliot Lee |
be1f689 |
is_in_proc_swaps(const char *fname) {
|
|
Elliot Lee |
be1f689 |
int i;
|
|
Elliot Lee |
be1f689 |
|
|
Elliot Lee |
be1f689 |
- for (i = 0; i < numSwaps; i++)
|
|
Elliot Lee |
be1f689 |
- if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
|
|
Elliot Lee |
be1f689 |
+ for (i = 0; i < numSwaps; i++) {
|
|
Elliot Lee |
be1f689 |
+ struct stat swapped, swapping;
|
|
Elliot Lee |
be1f689 |
+
|
|
Elliot Lee |
be1f689 |
+ if (!swapFiles[i]) continue;
|
|
Elliot Lee |
be1f689 |
+
|
|
Elliot Lee |
be1f689 |
+ if (!strcmp(fname, swapFiles[i])
|
|
Elliot Lee |
be1f689 |
+ || (!stat (swapFiles[i], &swapped)
|
|
Elliot Lee |
be1f689 |
+ && !stat (fname, &swapping)
|
|
Elliot Lee |
be1f689 |
+ && (swapped.st_dev == swapping.st_dev
|
|
Elliot Lee |
c420d81 |
+ && swapped.st_ino == swapping.st_ino))
|
|
Elliot Lee |
be1f689 |
+ )
|
|
Elliot Lee |
be1f689 |
return 1;
|
|
Elliot Lee |
be1f689 |
+ }
|
|
Elliot Lee |
be1f689 |
return 0;
|
|
Elliot Lee |
be1f689 |
}
|
|
Elliot Lee |
be1f689 |
|