diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-30 17:24:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-30 17:24:37 +0200 |
commit | 76603baac5a14445d0c41d7eb14144a07288d357 (patch) | |
tree | c346afc0d8a330c31f41d6cfc589897a42f1d2fb | |
parent | 207f009326c8f878defde0e594d7d9ed9860106e (diff) | |
download | vim-git-76603baac5a14445d0c41d7eb14144a07288d357.tar.gz |
patch 8.2.1545: ch_logfile() is unclear about closing when forkingv8.2.1545
Problem: ch_logfile() is unclear about closing when forking.
Solution: Adjust the log messages.
-rw-r--r-- | src/channel.c | 5 | ||||
-rw-r--r-- | src/os_unix.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c index 0b41133c2..1a899e8aa 100644 --- a/src/channel.c +++ b/src/channel.c @@ -144,6 +144,7 @@ fd_close(sock_T fd) // 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,7 +159,7 @@ ch_logfile(char_u *fname, char_u *opt) if (*fname != NUL) ch_log(NULL, "closing this logfile, opening %s", fname); else - ch_log(NULL, "closing logfile"); + ch_log(NULL, "closing logfile %s", log_name); fclose(log_fd); } @@ -170,6 +171,8 @@ ch_logfile(char_u *fname, char_u *opt) semsg(_(e_notopen), fname); return; } + vim_free(log_name); + log_name = vim_strsave(fname); } log_fd = file; diff --git a/src/os_unix.c b/src/os_unix.c index 73caa1a3e..b58138bf0 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4683,8 +4683,10 @@ mch_call_shell_fork( # ifdef FEAT_JOB_CHANNEL 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 *)""); + } # endif if (!show_shell_mess || (options & SHELL_EXPAND)) diff --git a/src/version.c b/src/version.c index 1fe5b26df..912528bbf 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1545, +/**/ 1544, /**/ 1543, |