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

Re: daemon.c fails to build on Darwin

From
Alex Riesen <raa.lkml@gmail.com>
Date
Sep 28, 2006, 16:01 UTC
Message-ID
<81b0412b0609280901q109961cfydeaea7ff305eca67@mail.gmail.com>
In-Reply-To
<86ejtw3sbv.fsf@blue.stonehenge.com>
On 28 Sep 2006 08:48:36 -0700, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>
> If this is obvious, can someone fix it?  If not, I'll try to sort it out later
> tonight.
>
I used the patch attached.
BTW, could we please _use_ the const keyword?
diff --git a/daemon.c b/daemon.c
index 5335d21..8b54c63 100644
--- a/daemon.c
+++ b/daemon.c
@@ -830,7 +830,7 @@ #endif
 
 #else /* NO_IPV6 */
 
-static int socksetup(char *lisen_addr, int listen_port, int **socklist_p)
+static int socksetup(char *listen_addr, int listen_port, int **socklist_p)
 {
 	struct sockaddr_in sin;
 	int sockfd;
diff --git a/git-compat-util.h b/git-compat-util.h
index 7ed18e1..a5429d1 100755
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -33,6 +33,10 @@ #ifndef PATH_MAX
 #define PATH_MAX 4096
 #endif
 
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 256
+#endif
+
 #ifdef __GNUC__
 #define NORETURN __attribute__((__noreturn__))
 #else
diff --git a/interpolate.c b/interpolate.c
index 62701d8..5d9d188 100644
--- a/interpolate.c
+++ b/interpolate.c
@@ -8,10 +8,10 @@ #include "git-compat-util.h"
 #include "interpolate.h"
 
 
-void interp_set_entry(struct interp *table, int slot, char *value)
+void interp_set_entry(struct interp *table, int slot, const char *value)
 {
 	char *oldval = table[slot].value;
-	char *newval = value;
+	char *newval = NULL;
 
 	if (oldval)
 		free(oldval);
diff --git a/interpolate.h b/interpolate.h
index a55fb8e..190a180 100644
--- a/interpolate.h
+++ b/interpolate.h
@@ -16,7 +16,7 @@ struct interp {
 	char *value;
 };
 
-extern void interp_set_entry(struct interp *table, int slot, char *value);
+extern void interp_set_entry(struct interp *table, int slot, const char *value);
 extern void interp_clear_table(struct interp *table, int ninterps);
 
 extern int interpolate(char *result, int reslen,
Previous: Randal L. SchwartzNext: Shawn Pearce
Message 2 of 4 in “daemon.c fails to build on Darwin”
  1. Randal L. SchwartzSep 28, 2006
  2. Alex RiesenSep 28, 2006
  3. Shawn PearceSep 28, 2006
  4. Junio C HamanoSep 28, 2006

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.