mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1545: ch_logfile() is unclear about closing when forking
Problem: ch_logfile() is unclear about closing when forking. Solution: Adjust the log messages.
This commit is contained in:
@@ -144,6 +144,7 @@ fd_close(sock_T fd)
|
|||||||
|
|
||||||
// Log file opened with ch_logfile().
|
// Log file opened with ch_logfile().
|
||||||
static FILE *log_fd = NULL;
|
static FILE *log_fd = NULL;
|
||||||
|
static char_u *log_name = NULL;
|
||||||
#ifdef FEAT_RELTIME
|
#ifdef FEAT_RELTIME
|
||||||
static proftime_T log_start;
|
static proftime_T log_start;
|
||||||
#endif
|
#endif
|
||||||
@@ -158,7 +159,7 @@ ch_logfile(char_u *fname, char_u *opt)
|
|||||||
if (*fname != NUL)
|
if (*fname != NUL)
|
||||||
ch_log(NULL, "closing this logfile, opening %s", fname);
|
ch_log(NULL, "closing this logfile, opening %s", fname);
|
||||||
else
|
else
|
||||||
ch_log(NULL, "closing logfile");
|
ch_log(NULL, "closing logfile %s", log_name);
|
||||||
fclose(log_fd);
|
fclose(log_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,6 +171,8 @@ ch_logfile(char_u *fname, char_u *opt)
|
|||||||
semsg(_(e_notopen), fname);
|
semsg(_(e_notopen), fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
vim_free(log_name);
|
||||||
|
log_name = vim_strsave(fname);
|
||||||
}
|
}
|
||||||
log_fd = file;
|
log_fd = file;
|
||||||
|
|
||||||
|
@@ -4683,8 +4683,10 @@ mch_call_shell_fork(
|
|||||||
|
|
||||||
# ifdef FEAT_JOB_CHANNEL
|
# ifdef FEAT_JOB_CHANNEL
|
||||||
if (ch_log_active())
|
if (ch_log_active())
|
||||||
// close the log file in the child
|
{
|
||||||
|
ch_log(NULL, "closing channel log in the child process");
|
||||||
ch_logfile((char_u *)"", (char_u *)"");
|
ch_logfile((char_u *)"", (char_u *)"");
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
if (!show_shell_mess || (options & SHELL_EXPAND))
|
if (!show_shell_mess || (options & SHELL_EXPAND))
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1545,
|
||||||
/**/
|
/**/
|
||||||
1544,
|
1544,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user