VirusTotal / yara

The pattern matching swiss knife
https://virustotal.github.io/yara/
BSD 3-Clause "New" or "Revised" License
7.95k stars 1.42k forks source link

semaphore_destroy: use sem_destroy on POSIX #2015

Closed chikei closed 7 months ago

chikei commented 7 months ago

per POSIX semaphore, sem_init should be paired with sem_destroy (unnamed semaphore), sem_close should be paired with sem_open (named one).

While glibc seems forgiving about this, this will cause hangs or segfaults with musl (for example, #1887).