VirusTotal / yara

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

semaphore_destroy: use sem_destroy on POSIX #2015

Closed chikei closed 12 months ago

chikei commented 12 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).