{"thread":{"id":"5737","subject":"daemon.c fails to build on Darwin","startedAt":"2006-09-28T15:48:36Z","lastAt":"2006-09-28T16:15:48Z","messageCount":4,"participants":["Randal L. Schwartz","Alex Riesen","Shawn Pearce","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"27893","messageId":"86ejtw3sbv.fsf@blue.stonehenge.com","threadId":"5737","inReplyTo":null,"subject":"daemon.c fails to build on Darwin","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-09-28T15:48:36Z","receivedAt":"2006-09-28T15:48:36Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":"\nIf this is obvious, can someone fix it?  If not, I'll try to sort it out later\ntonight.\n\n    gcc -o daemon.o -c -g -O2 -Wall -I/sw/include -I/opt/local/include -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRLCPY daemon.c\n    daemon.c: In function 'fill_in_extra_table_entries':\n    daemon.c:460: error: 'HOST_NAME_MAX' undeclared (first use in this function)\n    daemon.c:460: error: (Each undeclared identifier is reported only once\n    daemon.c:460: error: for each function it appears in.)\n    daemon.c:460: warning: unused variable 'addrbuf'\n    make: *** [daemon.o] Error 1\n\nThis is with 2d5b459107cf07bbb307cfb196c2007c497a6dd2.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"27894","messageId":"81b0412b0609280901q109961cfydeaea7ff305eca67@mail.gmail.com","threadId":"5737","inReplyTo":"86ejtw3sbv.fsf@blue.stonehenge.com","subject":"Re: daemon.c fails to build on Darwin","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-09-28T16:01:10Z","receivedAt":"2006-09-28T16:01:10Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 28 Sep 2006 08:48:36 -0700, Randal L. Schwartz <merlyn@stonehenge.com> wrote:\n>\n> If this is obvious, can someone fix it?  If not, I'll try to sort it out later\n> tonight.\n>\n\nI used the patch attached.\n\nBTW, could we please _use_ the const keyword?\n\n\ndiff --git a/daemon.c b/daemon.c\nindex 5335d21..8b54c63 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -830,7 +830,7 @@ #endif\n \n #else /* NO_IPV6 */\n \n-static int socksetup(char *lisen_addr, int listen_port, int **socklist_p)\n+static int socksetup(char *listen_addr, int listen_port, int **socklist_p)\n {\n \tstruct sockaddr_in sin;\n \tint sockfd;\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 7ed18e1..a5429d1 100755\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -33,6 +33,10 @@ #ifndef PATH_MAX\n #define PATH_MAX 4096\n #endif\n \n+#ifndef HOST_NAME_MAX\n+#define HOST_NAME_MAX 256\n+#endif\n+\n #ifdef __GNUC__\n #define NORETURN __attribute__((__noreturn__))\n #else\ndiff --git a/interpolate.c b/interpolate.c\nindex 62701d8..5d9d188 100644\n--- a/interpolate.c\n+++ b/interpolate.c\n@@ -8,10 +8,10 @@ #include \"git-compat-util.h\"\n #include \"interpolate.h\"\n \n \n-void interp_set_entry(struct interp *table, int slot, char *value)\n+void interp_set_entry(struct interp *table, int slot, const char *value)\n {\n \tchar *oldval = table[slot].value;\n-\tchar *newval = value;\n+\tchar *newval = NULL;\n \n \tif (oldval)\n \t\tfree(oldval);\ndiff --git a/interpolate.h b/interpolate.h\nindex a55fb8e..190a180 100644\n--- a/interpolate.h\n+++ b/interpolate.h\n@@ -16,7 +16,7 @@ struct interp {\n \tchar *value;\n };\n \n-extern void interp_set_entry(struct interp *table, int slot, char *value);\n+extern void interp_set_entry(struct interp *table, int slot, const char *value);\n extern void interp_clear_table(struct interp *table, int ninterps);\n \n extern int interpolate(char *result, int reslen,\n"},{"id":"27895","messageId":"20060928160652.GC2947@spearce.org","threadId":"5737","inReplyTo":"86ejtw3sbv.fsf@blue.stonehenge.com","subject":"Re: daemon.c fails to build on Darwin","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-09-28T16:06:52Z","receivedAt":"2006-09-28T16:06:52Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"\"Randal L. Schwartz\" <merlyn@stonehenge.com> wrote:\n> \n> If this is obvious, can someone fix it?  If not, I'll try to sort it out later\n> tonight.\n> \n>     gcc -o daemon.o -c -g -O2 -Wall -I/sw/include -I/opt/local/include -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRLCPY daemon.c\n>     daemon.c: In function 'fill_in_extra_table_entries':\n>     daemon.c:460: error: 'HOST_NAME_MAX' undeclared (first use in this function)\n>     daemon.c:460: error: (Each undeclared identifier is reported only once\n>     daemon.c:460: error: for each function it appears in.)\n>     daemon.c:460: warning: unused variable 'addrbuf'\n>     make: *** [daemon.o] Error 1\n> \n> This is with 2d5b459107cf07bbb307cfb196c2007c497a6dd2.\n\nAccording to pickaxe it was dd4676299dde0a4c6f8a471e6353170f86a78c8a.\n\nLooks like HOST_NAME_MAX isn't defined on Darwin.  Looking at how\ndaemon.c is using it this just needs to be defined to a suitable\nlength if its not already defined.  Sort of like PATH_MAX on some\nother systems...\n\n-- \nShawn.\n"},{"id":"27898","messageId":"7vbqp0vuff.fsf@assigned-by-dhcp.cox.net","threadId":"5737","inReplyTo":"86ejtw3sbv.fsf@blue.stonehenge.com","subject":"Re: daemon.c fails to build on Darwin","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-28T16:15:48Z","receivedAt":"2006-09-28T16:15:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"merlyn@stonehenge.com (Randal L. Schwartz) writes:\n\n> If this is obvious, can someone fix it?  If not, I'll try to sort it out later\n> tonight.\n>\n>     gcc -o daemon.o -c -g -O2 -Wall -I/sw/include -I/opt/local/include -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRLCPY daemon.c\n>     daemon.c: In function 'fill_in_extra_table_entries':\n>     daemon.c:460: error: 'HOST_NAME_MAX' undeclared (first use in this function)\n>     daemon.c:460: error: (Each undeclared identifier is reported only once\n>     daemon.c:460: error: for each function it appears in.)\n>     daemon.c:460: warning: unused variable 'addrbuf'\n>     make: *** [daemon.o] Error 1\n>\n> This is with 2d5b459107cf07bbb307cfb196c2007c497a6dd2.\n\nSorry about that.  Johannes sent a fix which I'll apply.\n\nFrom: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nSubject: [PATCH/RFC] daemon: default to 256 for HOST_NAME_MAX if it is not defined\nDate: Thu, 28 Sep 2006 12:00:35 +0200 (CEST)\nMessage-ID: <Pine.LNX.4.63.0609281200200.14200@wbgn013.biozentrum.uni-wuerzburg.de>\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n\t... or should we make it wider available, by putting it into\n\tcache.h?\n\n daemon.c |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/daemon.c b/daemon.c\nindex 5335d21..fc3951c 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -15,6 +15,10 @@ #include \"cache.h\"\n #include \"exec_cmd.h\"\n #include \"interpolate.h\"\n \n+#ifndef HOST_NAME_MAX\n+#define HOST_NAME_MAX 256\n+#endif\n+\n static int log_syslog;\n static int verbose;\n static int reuseaddr;\n-- \n1.4.2.1.g430572-dirty\n"}]}