git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFD] socklen_t needs to be defined and libssl to be linked on old Mac OS X

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 28, 2005, 14:51 UTC
Message-ID
<Pine.LNX.4.58.0507281649230.25783@wgmdd8.biozentrum.uni-wuerzburg.de>

On older Mac OS X (10.2.8), no socklen_t is defined, and therefore daemon.c does not compile. However, Mac OS X 10.4 seems to define socklen_t differently.

Also, linking fails due to some symbols defined in libssl (not just libcrypto).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 Makefile |    4 ++++
 daemon.c |    3 +++
 2 files changed, 7 insertions
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -95,7 +95,11 @@ ifdef PPC_SHA1
   LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
 else
   SHA1_HEADER=<openssl/sha.h>
+ifeq ($(shell uname -s),Darwin)
+  LIBS += -lcrypto -lssl
+else
   LIBS += -lcrypto
+endif
 endif
 endif

diff --git a/daemon.c b/daemon.c
--- a/daemon.c
+++ b/daemon.c
@@ -5,6 +5,9 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#ifdef __APPLE__
+typedef int socklen_t;
+#endif

 static const char daemon_usage[] = "git-daemon [--inetd | --port=n]";
Next: Junio C Hamano
Message 1 of 3 in “[RFD] socklen_t needs to be defined and libssl to be linked on old Mac OS X”
  1. Johannes SchindelinJul 28, 2005
  2. Junio C HamanoJul 29, 2005
  3. Johannes SchindelinJul 29, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.