From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: neilb@suse.de, linux-nfs@vger.kernel.org
Subject: [PATCH 13/19] nfs-utils: Clean up support/nfs/rpcmisc.c:closedown()
Date: Fri, 05 Sep 2008 17:08:10 -0400 [thread overview]
Message-ID: <20080905210809.10001.75136.stgit@manray.1015granger.net> (raw)
In-Reply-To: <20080905210054.10001.8518.stgit-meopP2rzCrTwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
Clean up: update closedown()'s synopsis to modern C style, and move the
function so we can remove the forward declaration.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
support/nfs/rpcmisc.c | 48 +++++++++++++++++++++++++-----------------------
1 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/support/nfs/rpcmisc.c b/support/nfs/rpcmisc.c
index 40c2102..ad53a43 100644
--- a/support/nfs/rpcmisc.c
+++ b/support/nfs/rpcmisc.c
@@ -38,7 +38,6 @@
#define socklen_t int
#endif
-static void closedown(int sig);
int makesock(int port, int proto);
#define _RPCSVC_CLOSEDOWN 120
@@ -46,6 +45,31 @@ int _rpcpmstart = 0;
int _rpcfdtype = 0;
int _rpcsvcdirty = 0;
+static void
+closedown(int sig)
+{
+ (void) signal(sig, closedown);
+
+ if (_rpcsvcdirty == 0) {
+ static int size;
+ int i, openfd;
+
+ if (_rpcfdtype == SOCK_DGRAM)
+ exit(0);
+
+ if (size == 0)
+ size = getdtablesize();
+
+ for (i = 0, openfd = 0; i < size && openfd < 2; i++)
+ if (FD_ISSET(i, &svc_fdset))
+ openfd++;
+ if (openfd <= 1)
+ exit(0);
+ }
+
+ (void) alarm(_RPCSVC_CLOSEDOWN);
+}
+
void
rpc_init(char *name, int prog, int vers,
void (*dispatch)(struct svc_req *, register SVCXPRT *),
@@ -144,28 +168,6 @@ rpc_init(char *name, int prog, int vers,
}
}
-static void closedown(sig)
-int sig;
-{
- (void) signal(sig, closedown);
- if (_rpcsvcdirty == 0) {
- static int size;
- int i, openfd;
-
- if (_rpcfdtype == SOCK_DGRAM)
- exit(0);
- if (size == 0) {
- size = getdtablesize();
- }
- for (i = 0, openfd = 0; i < size && openfd < 2; i++)
- if (FD_ISSET(i, &svc_fdset))
- openfd++;
- if (openfd <= 1)
- exit(0);
- }
- (void) alarm(_RPCSVC_CLOSEDOWN);
-}
-
int makesock(int port, int proto)
{
struct sockaddr_in sin;
next prev parent reply other threads:[~2008-09-05 21:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-05 21:06 [PATCH 00/19] REPOST (with addn'l patches) nfs-utils cleanups Chuck Lever
[not found] ` <20080905210054.10001.8518.stgit-meopP2rzCrTwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-09-05 21:07 ` [PATCH 01/19] rpc.statd: refactor check to see if call is from loopback address Chuck Lever
2008-09-05 21:07 ` [PATCH 02/19] rpc.statd: eliminate --secure_statd Chuck Lever
2008-09-05 21:07 ` [PATCH 03/19] showmount: destroy RPC client when finished Chuck Lever
2008-09-05 21:07 ` [PATCH 04/19] showmount command: clean up error returns from connect_nb() Chuck Lever
2008-09-05 21:07 ` [PATCH 05/19] sm-notify command: include <config.h> Chuck Lever
2008-09-05 21:07 ` [PATCH 06/19] sm-notify command: getaddrinfo(3) addrinfo leak Chuck Lever
2008-09-05 21:07 ` [PATCH 07/19] sm-notify command: clean up error logging Chuck Lever
2008-09-05 21:07 ` [PATCH 08/19] sm-notify command: replace nsm_address typedef Chuck Lever
2008-09-05 21:07 ` [PATCH 09/19] sm-notify command: use static function definitions Chuck Lever
2008-09-05 21:07 ` [PATCH 10/19] nfs-utils: remove unused function rpc_logcall() Chuck Lever
2008-09-05 21:07 ` [PATCH 11/19] nfs-utils: Remove unused function rpc_svcrun() Chuck Lever
2008-09-05 21:08 ` [PATCH 12/19] nfs-utils: remove disabled code from support/nfs/rpcmisc.c Chuck Lever
2008-09-05 21:08 ` Chuck Lever [this message]
2008-09-05 21:08 ` [PATCH 14/19] nfs-utils: make makesock() static Chuck Lever
2008-09-05 21:08 ` [PATCH 15/19] nfs-utils: Remove excess log reporting Chuck Lever
2008-09-05 21:08 ` [PATCH 16/19] nfs-utils: whitespace clean ups in support/nfs/rpcmisc.c Chuck Lever
2008-09-05 21:08 ` [PATCH 17/19] rpc.statd: Clean up: replace "if (!(foo = rtnl))" Chuck Lever
2008-09-05 21:08 ` [PATCH 18/19] rpc.statd: Use __func__ in dprintf Chuck Lever
2008-09-05 21:08 ` [PATCH 19/19] rpc.statd: Stop overloading sockfd in utils/statd/rmtcall.c Chuck Lever
2008-09-29 11:07 ` [PATCH 00/19] REPOST (with addn'l patches) nfs-utils cleanups Steve Dickson
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=20080905210809.10001.75136.stgit@manray.1015granger.net \
--to=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=steved@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