public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: RHEL47 - rgmanager: Fix file descriptor leak caused by some events
Date: Mon, 20 Apr 2009 14:03:00 -0000 [thread overview]
Message-ID: <20090420140246.43D6312019B@lists.fedorahosted.org> (raw)
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;
reply other threads:[~2009-04-20 14:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090420140246.43D6312019B@lists.fedorahosted.org \
--to=lon@fedoraproject.org \
--cc=cluster-cvs-relay@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).