comparison src/os_win32.c @ 16453:4e9bea9b8025 v8.1.1231

patch 8.1.1231: asking about existing swap file unnecessarily commit https://github.com/vim/vim/commit/67cf86bfff5fd5224d557d81cb146f46e33b831c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 28 22:25:38 2019 +0200 patch 8.1.1231: asking about existing swap file unnecessarily Problem: Asking about existing swap file unnecessarily. Solution: When it is safe, delete the swap file. Remove HAS_SWAP_EXISTS_ACTION, it is always defined. (closes #1237)
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Apr 2019 22:30:06 +0200
parents 7ae2396cef62
children 1ae13586edf8
comparison
equal deleted inserted replaced
16452:a311ea84a94c 16453:4e9bea9b8025
2901 mch_get_pid(void) 2901 mch_get_pid(void)
2902 { 2902 {
2903 return (long)GetCurrentProcessId(); 2903 return (long)GetCurrentProcessId();
2904 } 2904 }
2905 2905
2906 /*
2907 * return TRUE if process "pid" is still running
2908 */
2909 int
2910 mch_process_running(pid_t pid)
2911 {
2912 HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0, (DWORD)pid);
2913 DWORD status = 0;
2914 int ret = FALSE;
2915
2916 if (hProcess == NULL)
2917 return FALSE; // might not have access
2918 if (GetExitCodeProcess(hProcess, &status) )
2919 ret = status == STILL_ACTIVE;
2920 CloseHandle(hProcess);
2921 return ret;
2922 }
2906 2923
2907 /* 2924 /*
2908 * Get name of current directory into buffer 'buf' of length 'len' bytes. 2925 * Get name of current directory into buffer 'buf' of length 'len' bytes.
2909 * Return OK for success, FAIL for failure. 2926 * Return OK for success, FAIL for failure.
2910 */ 2927 */