Merge branch 'ak/submodule-foreach-quoting'
[gitweb.git] / compat / mingw.c
index bb92c436f70790ba907991f3307aa0fe4afdf0f5..fecb98bcff74d2cbcb56e8f9f56d1f3b06339469 100644 (file)
@@ -491,7 +491,6 @@ int mingw_stat(const char *file_name, struct stat *buf)
        return do_stat_internal(1, file_name, buf);
 }
 
-#undef fstat
 int mingw_fstat(int fd, struct stat *buf)
 {
        HANDLE fh = (HANDLE)_get_osfhandle(fd);
@@ -1086,6 +1085,12 @@ int mingw_kill(pid_t pid, int sig)
                errno = err_win_to_posix(GetLastError());
                CloseHandle(h);
                return -1;
+       } else if (pid > 0 && sig == 0) {
+               HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
+               if (h) {
+                       CloseHandle(h);
+                       return 0;
+               }
        }
 
        errno = EINVAL;