git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] upload-pack: remove superfluous sigchain_pop() call
@ 2020-08-11 17:15 René Scharfe
  2020-08-11 18:26 ` Taylor Blau
  0 siblings, 1 reply; 3+ messages in thread
From: René Scharfe @ 2020-08-11 17:15 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

2997178ee6 (upload-pack: split check_unreachable() in two, prep for
get_reachable_list(), 2016-06-12) moved most code of has_unreachable()
into the new function do_reachable_revlist().  The latter takes care to
ignore SIGPIPE during its operations, and restores the original signal
handler before returning.

However, a sigchain_pop(SIGPIPE) call remained in the error handling
code of has_unreachable(), which does nothing because the stack is
empty after do_reachable_revlist() cleaned up after itself.  Remove it.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 upload-pack.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/upload-pack.c b/upload-pack.c
index d087113d23e..1b068da0d26 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -731,7 +731,6 @@ static int has_unreachable(struct object_array *src, enum allow_uor allow_uor)
 	return 0;

 error:
-	sigchain_pop(SIGPIPE);
 	if (cmd.out >= 0)
 		close(cmd.out);
 	return 1;
--
2.28.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] upload-pack: remove superfluous sigchain_pop() call
  2020-08-11 17:15 [PATCH] upload-pack: remove superfluous sigchain_pop() call René Scharfe
@ 2020-08-11 18:26 ` Taylor Blau
  2020-08-11 21:01   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Taylor Blau @ 2020-08-11 18:26 UTC (permalink / raw)
  To: René Scharfe
  Cc: Git Mailing List, Junio C Hamano,
	Nguyễn Thái Ngọc Duy

On Tue, Aug 11, 2020 at 07:15:03PM +0200, René Scharfe wrote:
> 2997178ee6 (upload-pack: split check_unreachable() in two, prep for
> get_reachable_list(), 2016-06-12) moved most code of has_unreachable()
> into the new function do_reachable_revlist().  The latter takes care to
> ignore SIGPIPE during its operations, and restores the original signal
> handler before returning.
>
> However, a sigchain_pop(SIGPIPE) call remained in the error handling
> code of has_unreachable(), which does nothing because the stack is
> empty after do_reachable_revlist() cleaned up after itself.  Remove it.

Thanks for noticing. Your analysis seems correct to me after a quick
inspection of the code, so this has my:

  Reviewed-by: Taylor Blau <me@ttaylorr.com>

> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
>  upload-pack.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/upload-pack.c b/upload-pack.c
> index d087113d23e..1b068da0d26 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -731,7 +731,6 @@ static int has_unreachable(struct object_array *src, enum allow_uor allow_uor)
>  	return 0;
>
>  error:
> -	sigchain_pop(SIGPIPE);
>  	if (cmd.out >= 0)
>  		close(cmd.out);
>  	return 1;
> --
> 2.28.0

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] upload-pack: remove superfluous sigchain_pop() call
  2020-08-11 18:26 ` Taylor Blau
@ 2020-08-11 21:01   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2020-08-11 21:01 UTC (permalink / raw)
  To: Taylor Blau
  Cc: René Scharfe, Git Mailing List,
	Nguyễn Thái Ngọc Duy

Taylor Blau <me@ttaylorr.com> writes:

> On Tue, Aug 11, 2020 at 07:15:03PM +0200, René Scharfe wrote:
>> 2997178ee6 (upload-pack: split check_unreachable() in two, prep for
>> get_reachable_list(), 2016-06-12) moved most code of has_unreachable()
>> into the new function do_reachable_revlist().  The latter takes care to
>> ignore SIGPIPE during its operations, and restores the original signal
>> handler before returning.
>>
>> However, a sigchain_pop(SIGPIPE) call remained in the error handling
>> code of has_unreachable(), which does nothing because the stack is
>> empty after do_reachable_revlist() cleaned up after itself.  Remove it.
>
> Thanks for noticing. Your analysis seems correct to me after a quick
> inspection of the code, so this has my:
>
>   Reviewed-by: Taylor Blau <me@ttaylorr.com>
>
>> Signed-off-by: René Scharfe <l.s.r@web.de>
>> ---
>>  upload-pack.c | 1 -
>>  1 file changed, 1 deletion(-)

Yeah, looks good to me, too.  Thanks, both.


>> diff --git a/upload-pack.c b/upload-pack.c
>> index d087113d23e..1b068da0d26 100644
>> --- a/upload-pack.c
>> +++ b/upload-pack.c
>> @@ -731,7 +731,6 @@ static int has_unreachable(struct object_array *src, enum allow_uor allow_uor)
>>  	return 0;
>>
>>  error:
>> -	sigchain_pop(SIGPIPE);
>>  	if (cmd.out >= 0)
>>  		close(cmd.out);
>>  	return 1;
>> --
>> 2.28.0
>
> Thanks,
> Taylor

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-11 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 17:15 [PATCH] upload-pack: remove superfluous sigchain_pop() call René Scharfe
2020-08-11 18:26 ` Taylor Blau
2020-08-11 21:01   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).