Merge branch 'jk/no-more-pre-exec-callback'
authorJeff King <peff@peff.net>
Thu, 25 Oct 2012 10:41:15 +0000 (06:41 -0400)
committerJeff King <peff@peff.net>
Thu, 25 Oct 2012 10:41:15 +0000 (06:41 -0400)
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

1  2 
run-command.c
diff --combined run-command.c
index 1101ef72378a502b1681a8e1bc306f38027974ae,dff28a7fcc4914196826a6838ab0f8d3fbf3db2b..3b982e4d55274ebe87c5751fa198bee53e371d9b
@@@ -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) {