[Devel] Self-comment code
Igor Podlesny
openvz at poige.ru
Sun Apr 28 20:31:58 PDT 2013
---
src/lib/fs_simfs.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/lib/fs_simfs.c b/src/lib/fs_simfs.c
index bc4bf9f..438c1f1 100644
--- a/src/lib/fs_simfs.c
+++ b/src/lib/fs_simfs.c
@@ -31,34 +31,35 @@
int vps_is_mounted(const char *root, const char *private)
{
- struct stat st1, st2;
+ struct stat st_root, st_parent;
char parent[PATH_MAX];
if (!root || !private)
return -1;
- if (stat(root, &st1)) {
+ if (stat(root, &st_root)) {
logger(-1, errno, "stat(%s)", root);
return -1;
}
snprintf(parent, sizeof(parent), "%s/..", root);
- if (stat(parent, &st2)) {
+ if (stat(parent, &st_parent)) {
logger(-1, errno, "stat(%s)", parent);
return -1;
}
/* Check for real mount (simfs or ploop) */
- if (st1.st_dev != st2.st_dev)
+ if (st_root.st_dev != st_parent.st_dev)
return 1;
/* Check for bind mount (upstream case) */
- if (stat(private, &st2)) {
+ if (stat(private, &st_parent)) {
logger(-1, errno, "stat(%s)", private);
return -1;
}
- return (st1.st_dev == st2.st_dev) && (st1.st_ino == st2.st_ino);
+ return (st_root.st_dev == st_parent.st_dev) &&
+ (st_root.st_ino == st_parent.st_ino);
}
static char *fs_name = "simfs";
--
1.7.9.5
More information about the Devel
mailing list