[PATCH] upload-pack: remove superfluous sigchain_pop() call

Subsystems: the rest

STALE2195d

2 messages, 2 authors, 2020-08-11 · open the first message on its own page

[PATCH] upload-pack: remove superfluous sigchain_pop() call

From: René Scharfe <hidden>
Date: 2020-08-11 17:15:18

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 <redacted>
---
 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

Re: [PATCH] upload-pack: remove superfluous sigchain_pop() call

From: Taylor Blau <hidden>
Date: 2020-08-11 18:26:08

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 [off-list ref]
quoted hunk
Signed-off-by: René Scharfe <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help