{"thread":{"id":"953","subject":"execlp sentinel","startedAt":"2005-06-15T15:33:55Z","lastAt":"2005-06-15T15:33:55Z","messageCount":1,"participants":["Jason Wright"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"4977","messageId":"20050615153355.GE12393@thought.net","threadId":"953","inReplyTo":null,"subject":"execlp sentinel","fromName":"Jason Wright","fromEmail":"jason@thought.net","sentAt":"2005-06-15T15:33:55Z","receivedAt":"2005-06-15T15:33:55Z","isPatch":false,"sender":{"key":"jason@thought.net","avatar":null},"body":"Another thing I ran into when porting cogito-0.11.3 to OpenBSD...  the\nNULL last argument to execlp() must be cast to a pointer type (NULL\nis an integer type on OpenBSD) in order for it to match as being\na proper sentinel value.\n\n--Jason L. Wright\n\n--- diff.c.orig\tThu Jun  9 05:15:09 2005\n+++ diff.c\tWed Jun 15 11:20:08 2005\n@@ -157,7 +157,7 @@ static void builtin_diff(const char *nam\n \t\t\texit(0);\n \t}\n \tfflush(NULL);\n-\texeclp(\"/bin/sh\",\"sh\", \"-c\", cmd, NULL);\n+\texeclp(\"/bin/sh\",\"sh\", \"-c\", cmd, (void *)NULL);\n }\n \n struct diff_filespec *alloc_filespec(const char *path)\n@@ -518,7 +518,7 @@ static void run_external_diff(const char\n \t\t\t\texecvp(pgm, (char *const*) exec_arg);\n \t\t\t}\n \t\t\telse\n-\t\t\t\texeclp(pgm, pgm, name, NULL);\n+\t\t\t\texeclp(pgm, pgm, name, (void *)NULL);\n \t\t}\n \t\t/*\n \t\t * otherwise we use the built-in one.\n--- merge-cache.c.orig\tTue Jun 14 17:07:44 2005\n+++ merge-cache.c\tTue Jun 14 17:07:50 2005\n@@ -23,7 +23,7 @@ static void run_program(void)\n \t\t\t    arguments[5],\n \t\t\t    arguments[6],\n \t\t\t    arguments[7],\n-\t\t\t    NULL);\n+\t\t\t    (void *)NULL);\n \t\tdie(\"unable to execute '%s'\", pgm);\n \t}\n \tif (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {\n--- rsh.c.orig\tWed Jun 15 11:21:57 2005\n+++ rsh.c\tWed Jun 15 11:22:08 2005\n@@ -57,7 +57,7 @@ int setup_connection(int *fd_in, int *fd\n \t\tclose(sv[1]);\n \t\tdup2(sv[0], 0);\n \t\tdup2(sv[0], 1);\n-\t\texeclp(\"ssh\", \"ssh\", host, command, NULL);\n+\t\texeclp(\"ssh\", \"ssh\", host, command, (void *)NULL);\n \t}\n \tclose(sv[0]);\n \t*fd_in = sv[1];\n"}]}