Patch 8.2.1545

5 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 30, 2020, 11:25:20 AM8/30/20
to vim...@googlegroups.com

Patch 8.2.1545
Problem: ch_logfile() is unclear about closing when forking.
Solution: Adjust the log messages.
Files: src/channel.c, src/os_unix.c


*** ../vim-8.2.1544/src/channel.c 2020-08-23 14:28:24.111838486 +0200
--- src/channel.c 2020-08-29 22:39:31.658201090 +0200
***************
*** 144,149 ****
--- 144,150 ----

// Log file opened with ch_logfile().
static FILE *log_fd = NULL;
+ static char_u *log_name = NULL;
#ifdef FEAT_RELTIME
static proftime_T log_start;
#endif
***************
*** 158,164 ****
if (*fname != NUL)
ch_log(NULL, "closing this logfile, opening %s", fname);
else
! ch_log(NULL, "closing logfile");
fclose(log_fd);
}

--- 159,165 ----
if (*fname != NUL)
ch_log(NULL, "closing this logfile, opening %s", fname);
else
! ch_log(NULL, "closing logfile %s", log_name);
fclose(log_fd);
}

***************
*** 170,175 ****
--- 171,178 ----
semsg(_(e_notopen), fname);
return;
}
+ vim_free(log_name);
+ log_name = vim_strsave(fname);
}
log_fd = file;

*** ../vim-8.2.1544/src/os_unix.c 2020-08-23 14:28:24.107838497 +0200
--- src/os_unix.c 2020-08-29 22:48:42.500659990 +0200
***************
*** 4683,4690 ****

# ifdef FEAT_JOB_CHANNEL
if (ch_log_active())
! // close the log file in the child
ch_logfile((char_u *)"", (char_u *)"");
# endif

if (!show_shell_mess || (options & SHELL_EXPAND))
--- 4683,4692 ----

# ifdef FEAT_JOB_CHANNEL
if (ch_log_active())
! {
! ch_log(NULL, "closing channel log in the child process");
ch_logfile((char_u *)"", (char_u *)"");
+ }
# endif

if (!show_shell_mess || (options & SHELL_EXPAND))
*** ../vim-8.2.1544/src/version.c 2020-08-30 15:49:12.158736328 +0200
--- src/version.c 2020-08-30 17:22:28.218072447 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1545,
/**/

--
"Never be afraid to tell the world who you are."
-- Anonymous

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages