From: Victoria Dye Date: Thu, 18 Aug 2022 21:40:47 +0000 (+0000) Subject: scalar-unregister: handle error codes greater than 0 X-Git-Tag: v2.38.0-rc0~56^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=adedcee8115038913ad551d88a9a040973066d4d;p=thirdparty%2Fgit.git scalar-unregister: handle error codes greater than 0 When 'scalar unregister' tries to disable maintenance and remove an enlistment, ensure that the return value is nonzero if either operation produces *any* nonzero return value, not just when they return a value less than 0. Signed-off-by: Victoria Dye Signed-off-by: Junio C Hamano --- diff --git a/contrib/scalar/scalar.c b/contrib/scalar/scalar.c index 92b648f351..8ef8dd5504 100644 --- a/contrib/scalar/scalar.c +++ b/contrib/scalar/scalar.c @@ -223,10 +223,10 @@ static int unregister_dir(void) { int res = 0; - if (toggle_maintenance(0) < 0) + if (toggle_maintenance(0)) res = -1; - if (add_or_remove_enlistment(0) < 0) + if (add_or_remove_enlistment(0)) res = -1; return res;