public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* RHEL5 - cman: Fix qdiskd file descriptor leak
@ 2008-09-02 15:35 Lon Hohberger
0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2008-09-02 15:35 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d5f2ef1b10bc529ba989781215b48c688b2c42b4
Commit: d5f2ef1b10bc529ba989781215b48c688b2c42b4
Parent: e9fec5cf0724fa209b0c0dc39e71a2c5ac72f36d
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:33:18 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 f3222ed..8cf7b5a 100644
--- a/cman/qdisk/disk.c
+++ b/cman/qdisk/disk.c
@@ -228,6 +228,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;
}
@@ -238,12 +239,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:34 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:35 RHEL5 - 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).