Patch 8.2.3041
Problem:    Detecting if the process of a swap file is running fails if the
            process is owned by another user.
Solution:   Check for the ESRCH error. (closes #8436)
Files:      src/os_unix.c


*** ../vim-8.2.3040/src/os_unix.c       2021-06-01 20:48:35.283404265 +0200
--- src/os_unix.c       2021-06-23 21:09:49.690146779 +0200
***************
*** 2486,2493 ****
      int
  mch_process_running(long pid)
  {
!     // EMX kill() not working correctly, it seems
!     return kill(pid, 0) == 0;
  }
  
  #if !defined(HAVE_STRERROR) && defined(USE_GETCWD)
--- 2486,2502 ----
      int
  mch_process_running(long pid)
  {
!     // If there is no error the process must be running.
!     if (kill(pid, 0) == 0)
!       return TRUE;
! #ifdef ESRCH
!     // If the error is ESRCH then the process is not running.
!     if (errno == ESRCH)
!       return FALSE;
! #endif
!     // If the process is running and owned by another user we get EPERM.  With
!     // other errors the process might be running, assuming it is then.
!     return TRUE;
  }
  
  #if !defined(HAVE_STRERROR) && defined(USE_GETCWD)
*** ../vim-8.2.3040/src/version.c       2021-06-23 20:46:46.914256853 +0200
--- src/version.c       2021-06-23 21:12:42.133663310 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3041,
  /**/

-- 
I am also told that there is a logical proof out there somewhere
that demonstrates that there is no task which duct tape cannot handle.
                                        -- Paul Brannan

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202106231913.15NJDjrR1225881%40masaka.moolenaar.net.

Raspunde prin e-mail lui