git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fix signal handler
Date: Wed, 10 Feb 2010 12:33:48 -0500	[thread overview]
Message-ID: <20100210173348.GA5091@coredump.intra.peff.net> (raw)
In-Reply-To: <4B72E81B.3020900@web.de>

On Wed, Feb 10, 2010 at 06:08:43PM +0100, Markus Elfring wrote:

> A global flag can only be set by a signal handler in a portable way if
> it has got the data type "sig_atomic_t". The previously used
> assignment of a function pointer in the function "early_output" was
> moved to another variable in the function "setup_early_output".
>
> The involved software design details were also mentioned on the
> mailing list.

Keep in mind commit messages will be read much later through "git log"
and the like.  Mentioning the mailing list is usually not very helpful
there. It is usually a good idea instead to summarize what was said on
the list for later readers of the commit (though in this case, I think
your first paragraph really says everything that needs to be said).

> --- a/builtin-log.c
> +++ b/builtin-log.c
> @@ -123,7 +123,7 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)
>  
>  static struct itimerval early_output_timer;
>  
> -static void log_show_early(struct rev_info *revs, struct commit_list *list)
> +extern void log_show_early(struct rev_info *revs, struct commit_list *list)

Why does this need to become extern? It looks like we are still just
assigning the function pointer from within this file.

> -volatile show_early_output_fn_t show_early_output;
> +sig_atomic_t show_early_output = 0;
> +show_early_output_fn_t early_output_function = NULL;

Good. I was worried from the above s/static/extern/ that you were going
to make log_show_early the only possible early output function, but the
way you did it is definitely the right way.

Overall, this change looks sane to me. You still haven't provided any
evidence that this is a problem in practice, but these changes are not
particularly cumbersome, so it is probably better to be on the safe
side.

-Peff

  parent reply	other threads:[~2010-02-10 17:34 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 16:14 Fix signal handler Markus Elfring
2010-02-02 20:58 ` Jeff King
2010-02-02 21:44   ` Markus Elfring
2010-02-02 22:32     ` Jeff King
2010-02-03 10:20       ` Markus Elfring
2010-02-03 10:29         ` Jeff King
2010-02-03 11:55           ` Markus Elfring
2010-02-03 13:12             ` Thomas Rast
2010-02-03 15:46               ` Markus Elfring
2010-02-03 15:52                 ` Shawn O. Pearce
2010-02-03 15:53                 ` Andreas Ericsson
2010-02-03 16:24                   ` Markus Elfring
2010-02-04  7:23                     ` Andreas Ericsson
2010-02-03 15:17             ` Jeff King
2010-02-03 16:04               ` Markus Elfring
2010-02-03 16:26                 ` Bill Lear
2010-02-09 18:01   ` Markus Elfring
2010-02-09 23:49     ` Daniel Barkalow
2010-02-10 17:08     ` [PATCH] " Markus Elfring
2010-02-10 17:14       ` Shawn O. Pearce
2010-02-10 17:35         ` Jeff King
2010-02-10 17:33       ` Jeff King [this message]
2010-02-13 13:30         ` Markus Elfring
2010-02-14  6:47           ` Jeff King
2010-02-14 10:19             ` Junio C Hamano
2010-02-18 16:31               ` Markus Elfring
2010-02-18 20:06                 ` Junio C Hamano
2010-02-19 11:05                   ` Markus Elfring
2010-02-22 12:10                   ` [PATCH] Fix a " Markus Elfring
2010-02-22 18:31                     ` Junio C Hamano
2010-02-23  8:55                       ` Markus Elfring
2010-02-23  9:10                         ` Markus Elfring
2010-02-23 21:48                         ` Junio C Hamano
2010-02-24 10:38                           ` Markus Elfring
2010-02-24 10:51                             ` Andreas Ericsson
2010-02-24 11:08                           ` Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100210173348.GA5091@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Markus.Elfring@web.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).