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 <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Victoria Dye committed Aug 18, 2022 at 21:40 UTC adedcee8115038913ad551d88a9a040973066d4d
1 file changed +2 -2
contrib/scalar/scalar.c
+2 -2
@@ -223,10 +223,10 @@ static int unregister_dir(void)
223 {
224 int res = 0;
225
226 - if (toggle_maintenance(0) < 0)
226 + if (toggle_maintenance(0))
227 res = -1;
228
229 - if (add_or_remove_enlistment(0) < 0)
229 + if (add_or_remove_enlistment(0))
230 res = -1;
231
232 return res;