r= bind(sfd, (const struct sockaddr*)&socket_sun, salen);
if (r<0) diee("bind() on new listener");
- // We never want callers to get ECONNREFUSED!.
+ // We never want callers to get ECONNREFUSED. But:
// There is a race here: from my RTFM they may get ECONNREFUSED
- // if they tr between our bind() and listen(). But if they do, they'll
+ // if they try between our bind() and listen(). But if they do, they'll
// acquire the lock (serialising with us) and retry, and then it will work.
r = listen(sfd, INT_MAX);
if (r<0) diee("listen() for new listener");
if (got == (pid_t)-1) diee("waitpid setup [%ld]", (long)setup_pid);
if (got != setup_pid) diee("waitpid setup [%ld] gave [%ld]!",
(long)setup_pid, (long)got);
- if (status != 0) propagate_exit_status(status);
+ if (status != 0) propagate_exit_status(status, "invocation");
close(lockfd);
return fake_pair[0];
}
static void make_executor_argv(const char *const *argv) {
- #define EACH_NEW_ARGV(EACH) { \
+ const char *arg;
+ #define EACH_NEW_ARG(EACH) { \
arg = interp; { EACH } \
if ((arg = script)) { EACH } \
const char *const *walk = argv; \
}
size_t count = 1;
- MAKE_NEW_ARGV( (void)arg; count++; );
+ EACH_NEW_ARG( (void)arg; count++; );
- executor_argv = calloc(count, sizeof(char*));
+ const char **out = calloc(count, sizeof(char*));
+ executor_argv = (const char* const*)out;
if (!executor_argv) diee("allocate for arguments");
- char **out = executor_argv;
- MAKE_NEW_ARGV( *out++ = arg; );
+ EACH_NEW_ARG( *out++ = arg; );
*out++ = 0;
}