ocfs2-tools/0001-libo2dlm-Close-file-description-after-use.patch
Goldwyn Rodrigues c57803101a Accepting request 305879 from home:ganghe:branches:network:ha-clustering:Factory
- libo2dlm: Close file description after use
  + 0001-libo2dlm-Close-file-description-after-use.patch
- debugfs.ocfs2: Fix a bug in process_open_args()
  + 0002-debugfs.ocfs2-Fix-a-bug-in-process_open_args.patch

- Update ocfs2-tools.tar.bz2 to upstream v1.8.4
- Use new ocfs2-tools git URL https://github.com/markfasheh/ocfs2-tools.git
- Drop patches (merged upstream):
  - 0001-Use-cmap-for-getting-cluster-name.patch
  - 0002-Remove-controld-dependency-in-group_join-leave.patch
  - 0003-Auto-setup-cluster_stack-based-on-what-is-on-disk.patch
  - 0004-mkfs.ocfs2-Abort-if-cluster-information-is-not-detec.patch
  - 0005-mkfs-Setup-cluster_stack-if-not-setup-based-on-what-.patch
  - 0006-Auto-setup-pcmk-stack-as-default-if-no-stack-is-setu.patch

OBS-URL: https://build.opensuse.org/request/show/305879
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=82
2015-05-08 10:26:22 +00:00

35 lines
984 B
Diff

From 63a8fc605fc8dc1c4e327eb17ba6a5a614928608 Mon Sep 17 00:00:00 2001
From: piaojun <piaojun@huawei.com>
Date: Thu, 2 Apr 2015 20:46:47 +0800
Subject: [PATCH 1/2] libo2dlm: Close file description after use
In o2dlm_generate_random_value(), randfd should be closed after use.
Signed-off-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Alex Chen <alex.chen@huawei.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
libo2dlm/o2dlm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libo2dlm/o2dlm.c b/libo2dlm/o2dlm.c
index dbc642b..375f659 100644
--- a/libo2dlm/o2dlm.c
+++ b/libo2dlm/o2dlm.c
@@ -102,9 +102,10 @@ static errcode_t o2dlm_generate_random_value(int64_t *value)
if ((randfd = open("/dev/urandom", O_RDONLY)) == -1)
return O2DLM_ET_RANDOM;
- if (read(randfd, value, readlen) != readlen)
+ if (read(randfd, value, readlen) != readlen) {
+ close(randfd);
return O2DLM_ET_RANDOM;
-
+ }
close(randfd);
return 0;
--
2.1.2