public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL47 - rgmanager: Fix file descriptor leak caused by some events
@ 2009-04-20 14:03 Lon Hohberger
0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2009-04-20 14:03 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a1e8fd9d5db5f6a7c620d59a3e98752058785320
Commit: a1e8fd9d5db5f6a7c620d59a3e98752058785320
Parent: 90b5ce10f93bf97caa9d8076302488120aa28e4a
Author: Lon Hohberger <lhh@redhat.com>
AuthorDate: Thu Sep 11 12:47:20 2008 -0400
Committer: Lon Hohberger <lhh@redhat.com>
CommitterDate: Mon Apr 20 10:01:09 2009 -0400
rgmanager: Fix file descriptor leak caused by some events
rhbz#461954
---
rgmanager/src/daemons/main.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c
index 07fe206..05997aa 100644
--- a/rgmanager/src/daemons/main.c
+++ b/rgmanager/src/daemons/main.c
@@ -308,6 +308,7 @@ dispatch_msg(int fd, uint64_t nodeid)
ret = msg_peek(fd, &msg_hdr, sizeof(msg_hdr));
if (ret != sizeof (generic_msg_hdr)) {
clulog(LOG_ERR, "#37: Error receiving message header\n");
+ msg_close(fd);
return -1;
}
@@ -317,6 +318,7 @@ dispatch_msg(int fd, uint64_t nodeid)
clulog(LOG_ERR,
"#38: Invalid magic: Wanted 0x%08x, got 0x%08x\n",
GENERIC_HDR_MAGIC, msg_hdr.gh_magic);
+ msg_close(fd);
return -1;
}
@@ -362,6 +364,7 @@ dispatch_msg(int fd, uint64_t nodeid)
if (ret != sizeof(msg_sm)) {
clulog(LOG_ERR,
"#39: Error receiving entire request\n");
+ msg_close(fd);
return -1;
}
@@ -420,7 +423,7 @@ dispatch_msg(int fd, uint64_t nodeid)
clulog(LOG_ERR,
"#39: Error receiving entire request (%d/%d)\n",
ret, (int)sizeof(rg_state_msg_t));
- ret = -1;
+ msg_close(fd);
break;
}
@@ -432,6 +435,8 @@ dispatch_msg(int fd, uint64_t nodeid)
msg_rsm.rsm_state.rs_state,
msg_rsm.rsm_state.rs_owner,
msg_rsm.rsm_state.rs_last_owner);
+
+ msg_close(fd);
break;
case RG_EXITING:
@@ -450,6 +455,7 @@ dispatch_msg(int fd, uint64_t nodeid)
default:
clulog(LOG_DEBUG, "unhandled message request %d\n",
msg_hdr.gh_command);
+ msg_close(fd);
break;
}
return 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-20 14:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-20 14:03 cluster: RHEL47 - rgmanager: Fix file descriptor leak caused by some events 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).