summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65a9289)
raw | patch | inline | side by side (parent: 65a9289)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 11 Sep 2005 20:58:41 +0000 (13:58 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 12 Sep 2005 01:55:20 +0000 (18:55 -0700) |
This should work around the compilation problem Johannes Schindelin
and others had on Mac OS/X.
Quoting Linus:
Any operating system where socklen_t is anything else than "int" is
terminally broken. The people who introduced that typedef were confused,
and I actually had to argue with them that it was fundamentally wrong:
there is no other valid type than "int" that makes sense for it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
and others had on Mac OS/X.
Quoting Linus:
Any operating system where socklen_t is anything else than "int" is
terminally broken. The people who introduced that typedef were confused,
and I actually had to argue with them that it was fundamentally wrong:
there is no other valid type than "int" that makes sense for it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
daemon.c | patch | blob | history |
diff --git a/daemon.c b/daemon.c
index 24bac16668ffe4d2301719c48a22c48ec449cf7f..5100cf2f44d735c0e46aba74dff1504cc3c36ec6 100644 (file)
--- a/daemon.c
+++ b/daemon.c
static struct child {
pid_t pid;
- socklen_t addrlen;
+ int addrlen;
struct sockaddr_storage address;
} live_child[MAX_CHILDREN];
-static void add_child(int idx, pid_t pid, struct sockaddr *addr, socklen_t addrlen)
+static void add_child(int idx, pid_t pid, struct sockaddr *addr, int addrlen)
{
live_child[idx].pid = pid;
live_child[idx].addrlen = addrlen;
}
}
-static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
+static void handle(int incoming, struct sockaddr *addr, int addrlen)
{
pid_t pid = fork();
if (FD_ISSET(sockfd, &fds)) {
struct sockaddr_storage ss;
- socklen_t sslen = sizeof(ss);
+ int sslen = sizeof(ss);
int incoming = accept(sockfd, (struct sockaddr *)&ss, &sslen);
if (incoming < 0) {
switch (errno) {