Re: [PATCH] Fix signal handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Markus Elfring <Markus.Elfring@xxxxxx> wrote:
> How do Git software developers think about the appended update suggestion?
> Would you like to integrate such adjustments into your source code
> repository?

Finally, a concrete patch we can comment on!
 
> Subject: [PATCH] Fix a signal handler
> 
> 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.

Please line wrap your commit messages at ~70 characters per line.
This improves readability when reading the messages with tools like
`git log` and `gitk` where the lines aren't reflowed.

Please read Documentation/SubmittingPatches and add a Signed-off-by
line if you agree to the Developer's Certificate of Origin.


> +	early_output_function = &log_show_early;
...
> -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;
...
> +		if (show_early_output) {
> +			(*early_output_function)(revs, newlist);
> +			show_early_output = 0;
> +		}

The function pointer isn't necessary.  AFAIK its only called in
this one call site.  So you can make a direct reference to the
log_show_early function.

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]