"What's the meaning of exit -1 here ?"
No one has explicitly stated this yet, but the only way to know the answer is to ask the person who designed the code. Convention would say that return value should signal that the subroutine call failed in some way, but who is to say that the person who created this code was following convention? Your best hint is to inspect all the lines of code that call that subroutine and find a common pattern. Once you figure that out, remove the silly return codes and add some REAL exceptions instead.