git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] gc: reject if another gc is running, unless --force is given

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 3, 2013, 10:01 UTC
Message-ID
<20130803100113.GA8239@lanh>
In-Reply-To
<51FCD20E.8070406@kdbg.org>
On Sat, Aug 03, 2013 at 11:49:02AM +0200, Johannes Sixt wrote:
Show 5 quoted lines
> Am 03.08.2013 08:21, schrieb Nguyễn Thái Ngọc Duy:
> >  I changed mingw.h to add a stub uname() because I don't think MinGW
> >  port has that function, but that's totally untested.
> 
> Thanks, but we don't have kill(pid, 0), either :-(
Yeah, I should have checked. Will this work?
-- 8< --
diff --git a/compat/mingw.c b/compat/mingw.c
index bb92c43..14d92df 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1086,6 +1086,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_TERMINATE, FALSE, pid);
+		if (h) {
+			CloseHandle(h);
+			return 0;
+		}
 	}
 
 	errno = EINVAL;
-- 8< --
Previous: Johannes SixtNext: Johannes Sixt
Message 6 of 20 in “gc: reject if another gc is running, unless --force is given”
  1. gc: reject if another gc is running, unless --force is givenNguyễn Thái Ngọc Duy, Aug 3, 2013
  2. gc: reject if another gc is running, unless --force is givenNguyễn Thái Ngọc Duy, Aug 3, 2013
  3. Ramkumar RamachandraAug 3, 2013
  4. Duy NguyenAug 3, 2013
  5. Johannes SixtAug 3, 2013
  6. Duy NguyenAug 3, 2013
  7. Johannes SixtAug 3, 2013
  8. gc: reject if another gc is running, unless --force is givenNguyễn Thái Ngọc Duy, Aug 5, 2013
  9. Junio C HamanoAug 5, 2013
  10. Ramkumar RamachandraAug 5, 2013
  11. Junio C HamanoAug 6, 2013
  12. Ramkumar RamachandraAug 6, 2013
  13. gc: reject if another gc is running, unless --force is givenNguyễn Thái Ngọc Duy, Aug 8, 2013
  14. Junio C HamanoAug 8, 2013
  15. Duy NguyenAug 9, 2013
  16. Junio C HamanoAug 9, 2013
  17. Andres PereraAug 9, 2013
  18. Junio C HamanoAug 9, 2013
  19. Duy NguyenAug 10, 2013
  20. Andreas SchwabAug 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.