diff --git a/exec.cpp b/exec.cpp index 111cb50b5..d8d4efce4 100644 --- a/exec.cpp +++ b/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 ) { /* diff --git a/io.h b/io.h index df1cef9d6..806ec70c0 100644 --- a/io.h +++ b/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 > 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; diff --git a/postfork.cpp b/postfork.cpp index cf9c931f6..04defa35f 100644 --- a/postfork.cpp +++ b/postfork.cpp @@ -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,