From: Karel Zak Date: Thu, 20 Mar 2008 13:45:33 +0000 (+0100) Subject: swapon: remove unnecessary myrealpath() call X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07d9b366e4cad566d26780647cb081b07fae6416;p=util-linux swapon: remove unnecessary myrealpath() call Signed-off-by: Karel Zak --- diff --git a/mount/swapon.c b/mount/swapon.c index 6fce6fd6..33d2b135 100644 --- a/mount/swapon.c +++ b/mount/swapon.c @@ -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; }