summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/syscall.c')
-rw-r--r--libglusterfs/src/syscall.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c
index 8e2d56b8d63..6be240599fb 100644
--- a/libglusterfs/src/syscall.c
+++ b/libglusterfs/src/syscall.c
@@ -241,7 +241,12 @@ sys_statvfs (const char *path, struct statvfs *buf)
int
sys_close (int fd)
{
- return close (fd);
+ int ret = -1;
+
+ if (fd >= 0)
+ ret = close (fd);
+
+ return ret;
}