pikhq / musl-nscd

Musl-nscd is an implementation of the NSCD protocol, suitable for use with musl and with standard NSS modules
Other
46 stars 14 forks source link

Initialize semaphore properly. #16

Closed ericonr closed 3 years ago

ericonr commented 3 years ago

sem_t objects are opaque and don't have a static initializer available. For simplicity, add an init_socket_handling function which can be used to initialize other global variables, if necessary.

Luckily musl behaves fine with a zero initialized sem_t, only erroneously treating it as a process shared semaphore.