upload-pack: remove superfluous sigchain_pop() call
PATCH 1/1 upload-pack: remove superfluous sigchain_pop() call
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.
--- upload-pack.c | 1 - 1 file changed, 1 deletion(-)
upload-pack.c +0 -1
@@ -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
Quoted 9 lines · René Scharfe
2997178ee6(upload-pack: splitcheck_unreachable()in two, prep forget_reachable_list(), 2016-06-12) moved most code ofhas_unreachable()into the new functiondo_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 ofhas_unreachable(), which does nothing because the stack is empty afterdo_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:
Quoted 18 lines
Signed-off-by René Scharfe <[email protected]>--- upload-pack.c | 1 - 1 file changed, 1 deletion(-)upload-pack.c +0
-2@@ -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 ; --
Quoted 1 line
2.28.0
Thanks,
Taylor
Quoted 7 lines · Taylor Blau
Quoted 6 lines · René Scharfe
2997178ee6(upload-pack: splitcheck_unreachable()in two, prep forget_reachable_list(), 2016-06-12) moved most code ofhas_unreachable()into the new functiondo_reachable_revlist(). The latter takes care to ignore SIGPIPE during its operations, and restores the original signal handler before returning.
Quoted 13 lines
Quoted 3 lines
However, a
sigchain_pop(SIGPIPE)call remained in the error handling code ofhas_unreachable(), which does nothing because the stack is empty afterdo_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 <[email protected]>Quoted 4 lines
Signed-off-by René Scharfe <[email protected]>--- upload-pack.c | 1 - 1 file changed, 1 deletion(-)
Yeah, looks good to me, too. Thanks, both.
Quoted 17 lines
Quoted 13 lines
upload-pack.c +0
-2@@ -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 ; --Quoted 1 line
2.28.0
Thanks,
Taylor