summaryrefslogtreecommitdiff
path: root/hlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'hlink.c')
-rw-r--r--hlink.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hlink.c b/hlink.c
index 495c0a86..b6e6f28d 100644
--- a/hlink.c
+++ b/hlink.c
@@ -73,12 +73,12 @@ int check_hard_link(struct file_struct *file)
{
#if SUPPORT_HARD_LINKS
int low=0,high=hlink_count-1;
- int mid=0,ret=0;
+ int ret=0;
if (!hlink_list || !S_ISREG(file->mode)) return 0;
while (low != high) {
- mid = (low+high)/2;
+ int mid = (low+high)/2;
ret = hlink_compare(&hlink_list[mid],file);
if (ret == 0) break;
if (ret > 0)
@@ -87,12 +87,12 @@ int check_hard_link(struct file_struct *file)
low=mid+1;
}
- if (hlink_compare(&hlink_list[mid],file) != 0) return 0;
+ if (hlink_compare(&hlink_list[low],file) != 0) return 0;
- if (mid > 0 &&
- S_ISREG(hlink_list[mid-1].mode) &&
- file->dev == hlink_list[mid-1].dev &&
- file->inode == hlink_list[mid-1].inode)
+ if (low > 0 &&
+ S_ISREG(hlink_list[low-1].mode) &&
+ file->dev == hlink_list[low-1].dev &&
+ file->inode == hlink_list[low-1].inode)
return 1;
#endif