]> err.no Git - util-linux/commitdiff
swapon: remove unnecessary myrealpath() call
authorKarel Zak <kzak@redhat.com>
Thu, 20 Mar 2008 13:45:33 +0000 (14:45 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 20 Mar 2008 13:45:33 +0000 (14:45 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/swapon.c

index 6fce6fd62c4ce30c6e1f8c3c1cf6fbd1427448da..33d2b135f6d5081a5f0e7594af90e88666e11932 100644 (file)
@@ -144,17 +144,9 @@ read_proc_swaps(void) {
 static int
 is_in_proc_swaps(const char *fname) {
        int i;
-       char canonical[PATH_MAX + 2];
-
-       if (!myrealpath(fname, canonical, PATH_MAX + 1)) {
-               fprintf(stderr, _("%s: cannot canonicalize %s: %s\n"),
-                       progname, fname, strerror(errno));
-               strncpy(canonical, fname, PATH_MAX + 1);
-               *(canonical + (PATH_MAX + 1)) = '\0';
-       }
 
        for (i = 0; i < numSwaps; i++)
-               if (swapFiles[i] && !strcmp(canonical, swapFiles[i]))
+               if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
                        return 1;
        return 0;
 }