>Return value
>If the function succeeds, the return value is nonzero.
>If the function fails, the return value is zero. To get extended error information, call GetLastError.
>winapi
Return value
What's the problem here?
C does this too
*throws exception*
It works entirely opposite to how the Unix shell works (0 is success, nonzero is failure where each number corresponds to an error type) and makes no sense.
That's fucking retarded. Using raw integers for error codes is bad enough, but using 0 for failure is even worse.
1 is true, 0 is false, which one sounds more like success to you?
The most likely situation is that you have one kind of success and many kinds of failure. How many kinds of zero and how many kinds of nonzero values are there?
0, for no error. Also, it returns an integer value not a boolean value.
Posix has the same shit with errno.
Errno is the biggest mistake in C.