init: fix grammar and clarify comment

This commit is contained in:
Bert Belder 2018-11-26 16:43:01 -07:00
parent fca062c60d
commit 210f4f8fba
No known key found for this signature in database
GPG Key ID: 7A77887B2E2ED461

View File

@ -30,7 +30,11 @@ static BOOL CALLBACK init__once_callback(INIT_ONCE* once,
int init(void) {
if (!init__done &&
!InitOnceExecuteOnce(&init__once, init__once_callback, NULL, NULL))
return -1; /* LastError and errno aren't touched InitOnceExecuteOnce. */
/* `InitOnceExecuteOnce()` itself is infallible, and it doesn't set any
* error code when the once-callback returns FALSE. We return -1 here to
* indicate that global initialization failed; the failing init function is
* resposible for setting `errno` and calling `SetLastError()`. */
return -1;
return 0;
}