diff options
Diffstat (limited to 'support/misc/mountpoint.c')
-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; } |