From: Jeff King Date: Thu, 25 Oct 2012 10:41:15 +0000 (-0400) Subject: Merge branch 'jk/no-more-pre-exec-callback' X-Git-Tag: v1.8.1-rc0~110 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/55ff63007509d075d32861ff48cc8bb57d445b2a?ds=inline;hp=-c Merge branch 'jk/no-more-pre-exec-callback' Removes a workaround for buggy version of less older than version 406. * jk/no-more-pre-exec-callback: pager: drop "wait for output to run less" hack --- 55ff63007509d075d32861ff48cc8bb57d445b2a diff --combined run-command.c index 1101ef7237,dff28a7fcc..3b982e4d55 --- a/run-command.c +++ b/run-command.c @@@ -53,14 -53,13 +53,14 @@@ static void mark_child_for_cleanup(pid_ static void clear_child_for_cleanup(pid_t pid) { - struct child_to_clean **last, *p; + struct child_to_clean **pp; - last = &children_to_clean; - for (p = children_to_clean; p; p = p->next) { - if (p->pid == pid) { - *last = p->next; - free(p); + for (pp = &children_to_clean; *pp; pp = &(*pp)->next) { + struct child_to_clean *clean_me = *pp; + + if (clean_me->pid == pid) { + *pp = clean_me->next; + free(clean_me); return; } } @@@ -140,8 -139,6 +140,8 @@@ int sane_execvp(const char *file, char */ if (errno == EACCES && !strchr(file, '/')) errno = exists_in_PATH(file) ? EACCES : ENOENT; + else if (errno == ENOTDIR && !strchr(file, '/')) + errno = ENOENT; return -1; } @@@ -397,16 -394,6 +397,6 @@@ fail_pipe unsetenv(*cmd->env); } } - if (cmd->preexec_cb) { - /* - * We cannot predict what the pre-exec callback does. - * Forgo parent notification. - */ - close(child_notifier); - child_notifier = -1; - - cmd->preexec_cb(); - } if (cmd->git_cmd) { execv_git_cmd(cmd->argv); } else if (cmd->use_shell) {