My "exit(0)" function prints ": Success" to stdout. How can I stop this?

c, unix

Solution

It is `perror` prints out "Success", NOT `exit(0)`.

The reason is that before the call of `perror`, there is no error set (so the `errno` is 0 which is its default value when the program starts). So `perror` prints out `Success`.

check this

http://www.cplusplus.com/reference/cstdio/perror/

Problem

I have googled already. I can't figure out what's going on. This: ``` perror("some error message"); exit(0); ``` will print this to stdout: "some error message: Success"

Original source