Skip to content

Commit

Permalink
Merge branch 'jk/no-more-pre-exec-callback'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
peff committed Oct 25, 2012
2 parents 8c7a786 + e8320f3 commit 55ff630
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
18 changes: 0 additions & 18 deletions pager.c
Expand Up @@ -11,21 +11,6 @@
* something different on Windows.
*/

#ifndef WIN32
static void pager_preexec(void)
{
/*
* Work around bug in "less" by not starting it until we
* have real input
*/
fd_set in;

FD_ZERO(&in);
FD_SET(0, &in);
select(1, &in, NULL, &in, NULL);
}
#endif

static const char *pager_argv[] = { NULL, NULL };
static struct child_process pager_process;

Expand Down Expand Up @@ -93,9 +78,6 @@ void setup_pager(void)
static const char *env[] = { "LESS=FRSX", NULL };
pager_process.env = env;
}
#ifndef WIN32
pager_process.preexec_cb = pager_preexec;
#endif
if (start_command(&pager_process))
return;

Expand Down
10 changes: 0 additions & 10 deletions run-command.c
Expand Up @@ -397,16 +397,6 @@ int start_command(struct child_process *cmd)
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) {
Expand Down
1 change: 0 additions & 1 deletion run-command.h
Expand Up @@ -39,7 +39,6 @@ struct child_process {
unsigned stdout_to_stderr:1;
unsigned use_shell:1;
unsigned clean_on_exit:1;
void (*preexec_cb)(void);
};

int start_command(struct child_process *);
Expand Down

0 comments on commit 55ff630

Please sign in to comment.