]> granicus.if.org Git - vim/commitdiff
patch 8.2.1545: ch_logfile() is unclear about closing when forking v8.2.1545
authorBram Moolenaar <Bram@vim.org>
Sun, 30 Aug 2020 15:24:37 +0000 (17:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 30 Aug 2020 15:24:37 +0000 (17:24 +0200)
Problem:    ch_logfile() is unclear about closing when forking.
Solution:   Adjust the log messages.

src/channel.c
src/os_unix.c
src/version.c

index 0b41133c2d2a2bbe66ea21a9eb630025cc029d81..1a899e8aa8fc539499c67fbf11622aecff32e06c 100644 (file)
@@ -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;
 
index 73caa1a3e45324e37802ecb6b0d7a5fd5d206a47..b58138bf07433bd3c60549113238828b2e7b6138 100644 (file)
@@ -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))
index 1fe5b26dfd232c5310de22b715782b99b62465ab..912528bbfaeb1907e9c50a8d8c5922adb6a2e2e2 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1545,
 /**/
     1544,
 /**/