I've seen this in several places now - commands returning -1 on failure to the shell. It's a bug. Someone confused their posix style returns (0 on success, < 0 on failure) with program returns, which are an unsigned character. Thus, a return of -1 actually becomes 255 to the shell.
A return value of 1 instead of -1 does the right thing.