summaryrefslogtreecommitdiffstats
path: root/support/nsm/file.c
diff options
context:
space:
mode:
authorVivek Trivedi <t.vivek@samsung.com>2015-12-11 10:54:56 -0500
committerSteve Dickson <steved@redhat.com>2015-12-11 11:22:25 -0500
commit6f7a1d75f948f8d914e63f4ba4a24c97225689dc (patch)
tree50e70c7382866f9b52dad3821976ba952cf27311 /support/nsm/file.c
parent4c3f97bb8ea409651491113a43a6d2b9d752d1e7 (diff)
downloadnfs-utils-6f7a1d75f948f8d914e63f4ba4a24c97225689dc.tar.gz
nfs-utils-6f7a1d75f948f8d914e63f4ba4a24c97225689dc.tar.xz
nfs-utils-6f7a1d75f948f8d914e63f4ba4a24c97225689dc.zip
libnsm.a: do not close file if open failed
If file open failed, no need to issue close system call in nsm_get_state and closeall. Signed-off-by: Vivek Trivedi <t.vivek@samsung.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nsm/file.c')
-rw-r--r--support/nsm/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/support/nsm/file.c b/support/nsm/file.c
index 4711c2c..7a8b504 100644
--- a/support/nsm/file.c
+++ b/support/nsm/file.c
@@ -536,7 +536,8 @@ nsm_get_state(_Bool update)
state++;
update:
- (void)close(fd);
+ if(fd >= 0)
+ (void)close(fd);
if (update) {
state += 2;