summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syscall.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-04-24 16:36:52 +0530
committerAnand Avati <avati@redhat.com>2012-04-24 13:32:00 -0700
commit4a0f5e49f85f88912cc9c73b379403ead82e4912 (patch)
treef00bf7460d949b0507d9b053dd04bcf11cc36398 /libglusterfs/src/syscall.c
parent2a59514236630756dc996e08b50f539ccc2d3ff0 (diff)
glusterd: command check failure fixes
due to the patch 29f2de478cc6a475e6ae760d9cbe7ac847e9d79c (coverity issues fix), geo-replications assumption of anything other than -2 is valid error (ie, expected error), was broken, which resulted in staging failure of all geo-replication commands. now fixed!!! Change-Id: I26c3574e966dd8ba89ef423a3ad17aa863a62c13 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 815613 Reviewed-on: http://review.gluster.com/3219 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
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;
}