aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-02-17 13:30:41 -0800
committerJunio C Hamano <gitster@pobox.com>2026-02-17 13:30:41 -0800
commit5779c47fa0672e73ce35711e38d1a002787396f3 (patch)
tree09ba9b0284fb52bf2abbbfa205ce6dfd761e6ef9 /compat
parent852829b3dd2fe4e7c7fc4d8badde644cf1b66c74 (diff)
parentdbdcab6b89ea86fe58ece01bbb7be297ff23b2c4 (diff)
downloadgit-5779c47fa0672e73ce35711e38d1a002787396f3.tar.xz
Merge branch 'pc/lockfile-pid'
Allow recording process ID of the process that holds the lock next to a lockfile for diagnosis. * pc/lockfile-pid: lockfile: add PID file for debugging stale locks
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 628a3941d2..c667a2dcda 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2220,6 +2220,16 @@ int mingw_kill(pid_t pid, int sig)
CloseHandle(h);
return 0;
}
+ /*
+ * OpenProcess returns ERROR_INVALID_PARAMETER for
+ * non-existent PIDs. Map this to ESRCH for POSIX
+ * compatibility with kill(pid, 0).
+ */
+ if (GetLastError() == ERROR_INVALID_PARAMETER)
+ errno = ESRCH;
+ else
+ errno = err_win_to_posix(GetLastError());
+ return -1;
}
errno = EINVAL;