Skip to content

Commit adedcee

Browse files
vdyegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 65f6a9e commit adedcee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/scalar/scalar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ static int unregister_dir(void)
223223
{
224224
int res = 0;
225225

226-
if (toggle_maintenance(0) < 0)
226+
if (toggle_maintenance(0))
227227
res = -1;
228228

229-
if (add_or_remove_enlistment(0) < 0)
229+
if (add_or_remove_enlistment(0))
230230
res = -1;
231231

232232
return res;

0 commit comments

Comments
 (0)