From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Junio C Hamano <junkio@cox.net>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: [RFC][PATCH 08/10] Sparse: fix an "incorrect type in argument n" warning
Date: Fri, 08 Jun 2007 23:24:20 +0100 [thread overview]
Message-ID: <4669D714.5050805@ramsay1.demon.co.uk> (raw)
In particular, the warning referred to argument 3 in a call to
accept() and alluded to the type of the actual and formal arguments
being of a different signedness. The type of the formal parameter
of accept is (socklen_t *), rather than (unsigned int *) as used
here, so make the necessary changes to use socklen_t in the
appropriate places.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
daemon.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemon.c b/daemon.c
index 64f1f34..9daa850 100644
--- a/daemon.c
+++ b/daemon.c
@@ -604,11 +604,11 @@ static unsigned int children_deleted;
static struct child {
pid_t pid;
- int addrlen;
+ socklen_t addrlen;
struct sockaddr_storage address;
} live_child[MAX_CHILDREN];
-static void add_child(int idx, pid_t pid, struct sockaddr *addr, int addrlen)
+static void add_child(int idx, pid_t pid, struct sockaddr *addr, socklen_t addrlen)
{
live_child[idx].pid = pid;
live_child[idx].addrlen = addrlen;
@@ -702,7 +702,7 @@ static void check_max_connections(void)
}
}
-static void handle(int incoming, struct sockaddr *addr, int addrlen)
+static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
{
pid_t pid = fork();
@@ -917,7 +917,7 @@ static int service_loop(int socknum, int *socklist)
for (i = 0; i < socknum; i++) {
if (pfd[i].revents & POLLIN) {
struct sockaddr_storage ss;
- unsigned int sslen = sizeof(ss);
+ socklen_t sslen = sizeof(ss);
int incoming = accept(pfd[i].fd, (struct sockaddr *)&ss, &sslen);
if (incoming < 0) {
switch (errno) {
--
1.5.2
reply other threads:[~2007-06-08 23:39 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=4669D714.5050805@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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