public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* STABLE2 - cman: Fix qdiskd file descriptor leak
@ 2008-09-02 15:36 Lon Hohberger
0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2008-09-02 15:36 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a012dc47f024f327029865073a41afd573a4b5d0
Commit: a012dc47f024f327029865073a41afd573a4b5d0
Parent: 75695e0c5cdd2511aef1b52a46dbf69ff95869dc
Author: Lon Hohberger <lhh@redhat.com>
AuthorDate: Tue Sep 2 11:33:18 2008 -0400
Committer: Lon Hohberger <lhh@redhat.com>
CommitterDate: Tue Sep 2 11:34:31 2008 -0400
cman: Fix qdiskd file descriptor leak
Patch from Sean E. Millichamp <sean at bruenor dot org>
rhbz#460645
---
cman/qdisk/disk.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cman/qdisk/disk.c b/cman/qdisk/disk.c
index 6c591f3..6839c95 100644
--- a/cman/qdisk/disk.c
+++ b/cman/qdisk/disk.c
@@ -209,6 +209,7 @@ qdisk_open(char *name, target_info_t *disk)
ret = ioctl(disk->d_fd, BLKSSZGET, &ssz);
if (ret < 0) {
perror("qdisk_open: ioctl(BLKSSZGET)");
+ close(disk->d_fd);
return -1;
}
@@ -219,12 +220,14 @@ qdisk_open(char *name, target_info_t *disk)
ret = lseek(disk->d_fd, END_OF_DISK(disk->d_blksz), SEEK_SET);
if (ret < 0) {
perror("open_partition: seek");
+ close(disk->d_fd);
return -1;
}
if (ret < END_OF_DISK(disk->d_blksz)) {
fprintf(stderr, "Partition %s too small\n", name);
errno = EINVAL;
+ close(disk->d_fd);
return -1;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-09-02 15:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-02 15:36 STABLE2 - cman: Fix qdiskd file descriptor leak Lon Hohberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).