diff options
author | Greg Banks <gnb@melbourne.sgi.com> | 2006-07-03 14:21:48 +1000 |
---|---|---|
committer | Greg Banks <gnb@melbourne.sgi.com> | 2006-07-03 14:21:48 +1000 |
commit | 940c7c304d4a43c00c27529cdddc7c87db6eef87 (patch) | |
tree | b2d1f4d190afd1c21e8e31eada9d6e58cfa0f93b /support/misc | |
parent | b90d201551aaa712c011c3d5de900fad714a26a6 (diff) | |
parent | a503848d423fe1681879936da7b526b15f7eca23 (diff) | |
download | nfs-utils-940c7c304d4a43c00c27529cdddc7c87db6eef87.tar.gz nfs-utils-940c7c304d4a43c00c27529cdddc7c87db6eef87.tar.xz nfs-utils-940c7c304d4a43c00c27529cdddc7c87db6eef87.zip |
Merge branch 'master' of git://linux-nfs.org/nfs-utils
Diffstat (limited to 'support/misc')
-rw-r--r-- | support/misc/mountpoint.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c index 6d0f34e..750b6e8 100644 --- a/support/misc/mountpoint.c +++ b/support/misc/mountpoint.c @@ -20,15 +20,20 @@ is_mountpoint(char *path) */ char *dotdot; struct stat stb, pstb; + int rv; + + dotdot = xmalloc(strlen(path)+4); - dotdot = malloc(strlen(path)+4); strcat(strcpy(dotdot, path), "/.."); if (lstat(path, &stb) != 0 || lstat(dotdot, &pstb) != 0) - return 0; - - if (stb.st_dev != pstb.st_dev - || stb.st_ino == pstb.st_ino) - return 1; - return 0; + rv = 0; + else + if (stb.st_dev != pstb.st_dev || + stb.st_ino == pstb.st_ino) + rv = 1; + else + rv = 0; + free(dotdot); + return rv; } |