mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Flip the switch to stop draining threads before exec (!)
This commit is contained in:
parent
d173bb6e0a
commit
14a35e7c21
3 changed files with 3 additions and 4 deletions
2
exec.cpp
2
exec.cpp
|
@ -1255,7 +1255,7 @@ void exec( parser_t &parser, job_t *j )
|
|||
if (g_log_forks) {
|
||||
printf("forking for '%s' in '%ls'\n", actual_cmd, reader_current_filename());
|
||||
}
|
||||
pid = execute_fork(true /* must drain threads */);
|
||||
pid = execute_fork(false);
|
||||
if( pid == 0 )
|
||||
{
|
||||
/*
|
||||
|
|
4
io.h
4
io.h
|
@ -17,7 +17,7 @@ enum io_mode
|
|||
class io_data_t
|
||||
{
|
||||
private:
|
||||
/** buffer to save output in for IO_BUFFER. Note that in the original fish, the buffer was a pointer to a buffer_t stored in the param2 union down below, and when an io_data_t was duplicated the pointer was copied so that two io_data_ts referenced the same buffer. It's not clear to me how this was ever cleaned up correctly. But it's important that they share the same buffer for reasons I don't yet understand either. But we can get correct sharing and cleanup with shared_ptr. */
|
||||
/** buffer to save output in for IO_BUFFER. Note that in the original fish, the buffer was a pointer to a buffer_t stored in the param2 union down below, and when an io_data_t was duplicated the pointer was copied so that two io_data_ts referenced the same buffer. It's not clear to me how this was ever cleaned up correctly. But it's important that they share the same buffer for reasons I don't yet understand either. We can get correct sharing and cleanup with shared_ptr. */
|
||||
shared_ptr<std::vector<char> > out_buffer;
|
||||
|
||||
/* No assignment allowed */
|
||||
|
@ -36,7 +36,7 @@ public:
|
|||
{
|
||||
/** Fds for IO_PIPE and for IO_BUFFER */
|
||||
int pipe_fd[2];
|
||||
/** fd to redirect specified fd to, for IO_FD*/
|
||||
/** fd to redirect specified fd to, for IO_FD */
|
||||
int old_fd;
|
||||
} param1;
|
||||
|
||||
|
|
|
@ -68,7 +68,6 @@ int set_child_group( job_t *j, process_t *p, int print_errors )
|
|||
format_long_safe(getpgid_buff, getpgid( p->pid));
|
||||
format_long_safe(job_pgid_buff, j->pgid);
|
||||
|
||||
// PCA FIXME This is sketchy to do in a forked child because it may allocate memory. This needs to call only safe functions.
|
||||
debug_safe( 1,
|
||||
"Could not send process %s, '%s' in job %s, '%s' from group %s to group %s",
|
||||
pid_buff,
|
||||
|
|
Loading…
Reference in a new issue