Skip to content

Commit

Permalink
daemon: use socklen_t
Browse files Browse the repository at this point in the history
Windows's accept()-function takes the last argument as an int, but glibc
takes an unsigned int. Use socklen_t to get rid of a warning. This is
basically a revert of 7fa0908, but we have already been depending on
socklen_t existing since June 2006 (commit 5b276ee). I guess this means
that socklen_t IS defined on OSX after all - at least in recent headers.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Erik Faye-Lund authored and Junio C Hamano committed Nov 4, 2010
1 parent fdc1211 commit c295cf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static struct child {
struct sockaddr_storage address;
} *firstborn;

static void add_child(struct child_process *cld, struct sockaddr *addr, int addrlen)
static void add_child(struct child_process *cld, struct sockaddr *addr, socklen_t addrlen)
{
struct child *newborn, **cradle;

Expand Down Expand Up @@ -654,7 +654,7 @@ static void check_dead_children(void)
}

static char **cld_argv;
static void handle(int incoming, struct sockaddr *addr, int addrlen)
static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
{
struct child_process cld = { 0 };
char addrbuf[300] = "REMOTE_ADDR=", portbuf[300];
Expand Down Expand Up @@ -910,7 +910,7 @@ static int service_loop(struct socketlist *socklist)
struct sockaddr_in6 sai6;
#endif
} ss;
unsigned int sslen = sizeof(ss);
socklen_t sslen = sizeof(ss);
int incoming = accept(pfd[i].fd, &ss.sa, &sslen);
if (incoming < 0) {
switch (errno) {
Expand Down

0 comments on commit c295cf0

Please sign in to comment.