scanner: Fix the setter prototype and return value

A setter is expected to return 0 on success and -1 on failulre.