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

Re: Fix signal handler

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 9, 2010, 23:49 UTC
Message-ID
<alpine.LNX.2.00.1002091812290.14365@iabervon.org>
In-Reply-To
<4B71A2EE.8070708@web.de>
On Tue, 9 Feb 2010, Markus Elfring wrote:
Show 17 quoted lines
> 
> >
> > If you can demonstrate a practical problem and provide a patch, then I
> > am sure people would be happy to read it.
> >   
> 
> I need a few further clarifications on this issue to choose a potential fix.
> 
> I have noticed that the variable "show_early_output" gets a value
> assigned only at a few places in the source code. I wonder that the set
> pointer is only used by the function "limit_list" to call the function
> "log_show_early" on demand.
> http://git.kernel.org/?p=git/git.git;a=blob;f=revision.c;h=3ba6d991f6e9789949c314c2981dfc6b208a6f66;hb=HEAD#l683
> 
> I find that a simple flag would be sufficient. I see no need to handle
> different function pointers here. Do any objections exist to achieve the
> same effect with the data type "sig_atomic_t"?

In that particular instance, there's actually a comment that says it uses an int (which is almost certainly what sig_atomic_t is, but sig_atomic_t might not be defined on some actual platforms). Making the code match the comment, at least, would be good.

In particular, function pointers are more likely than other pointers to be not a machine word. I'm pretty sure that an IA64 machine could potentially have a race with a small window here.

As to whether to use int (as the comment says) or sig_atomic_t, I don't really have any idea which would have fewer problems.

	-Daniel
*This .sig left intentionally blank*
Previous: Markus ElfringNext: Markus Elfring
Message 18 of 36 in “Fix signal handler”
  1. Markus ElfringFeb 2, 2010
  2. Jeff KingFeb 2, 2010
  3. Markus ElfringFeb 2, 2010
  4. Jeff KingFeb 2, 2010
  5. Markus ElfringFeb 3, 2010
  6. Jeff KingFeb 3, 2010
  7. Markus ElfringFeb 3, 2010
  8. Thomas RastFeb 3, 2010
  9. Markus ElfringFeb 3, 2010
  10. Shawn O. PearceFeb 3, 2010
  11. Andreas EricssonFeb 3, 2010
  12. Markus ElfringFeb 3, 2010
  13. Andreas EricssonFeb 4, 2010
  14. Jeff KingFeb 3, 2010
  15. Markus ElfringFeb 3, 2010
  16. Bill LearFeb 3, 2010
  17. Markus ElfringFeb 9, 2010
  18. Daniel BarkalowFeb 9, 2010
  19. Markus ElfringFeb 10, 2010
  20. Shawn O. PearceFeb 10, 2010
  21. Jeff KingFeb 10, 2010
  22. Jeff KingFeb 10, 2010
  23. Markus ElfringFeb 13, 2010
  24. Jeff KingFeb 14, 2010
  25. Junio C HamanoFeb 14, 2010
  26. Markus ElfringFeb 18, 2010
  27. Junio C HamanoFeb 18, 2010
  28. Markus ElfringFeb 19, 2010
  29. Markus ElfringFeb 22, 2010
  30. Junio C HamanoFeb 22, 2010
  31. Markus ElfringFeb 23, 2010
  32. Markus ElfringFeb 23, 2010
  33. Junio C HamanoFeb 23, 2010
  34. Markus ElfringFeb 24, 2010
  35. Andreas EricssonFeb 24, 2010
  36. Markus ElfringFeb 24, 2010

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.