Skip to content

Commit 55ff630

Browse files
committed
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
2 parents 8c7a786 + e8320f3 commit 55ff630

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

pager.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,6 @@
1111
* something different on Windows.
1212
*/
1313

14-
#ifndef WIN32
15-
static void pager_preexec(void)
16-
{
17-
/*
18-
* Work around bug in "less" by not starting it until we
19-
* have real input
20-
*/
21-
fd_set in;
22-
23-
FD_ZERO(&in);
24-
FD_SET(0, &in);
25-
select(1, &in, NULL, &in, NULL);
26-
}
27-
#endif
28-
2914
static const char *pager_argv[] = { NULL, NULL };
3015
static struct child_process pager_process;
3116

@@ -93,9 +78,6 @@ void setup_pager(void)
9378
static const char *env[] = { "LESS=FRSX", NULL };
9479
pager_process.env = env;
9580
}
96-
#ifndef WIN32
97-
pager_process.preexec_cb = pager_preexec;
98-
#endif
9981
if (start_command(&pager_process))
10082
return;
10183

run-command.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -397,16 +397,6 @@ int start_command(struct child_process *cmd)
397397
unsetenv(*cmd->env);
398398
}
399399
}
400-
if (cmd->preexec_cb) {
401-
/*
402-
* We cannot predict what the pre-exec callback does.
403-
* Forgo parent notification.
404-
*/
405-
close(child_notifier);
406-
child_notifier = -1;
407-
408-
cmd->preexec_cb();
409-
}
410400
if (cmd->git_cmd) {
411401
execv_git_cmd(cmd->argv);
412402
} else if (cmd->use_shell) {

run-command.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ struct child_process {
3939
unsigned stdout_to_stderr:1;
4040
unsigned use_shell:1;
4141
unsigned clean_on_exit:1;
42-
void (*preexec_cb)(void);
4342
};
4443

4544
int start_command(struct child_process *);

0 commit comments

Comments
 (0)