fdm: when logging signal related errors, include the signal name

Since sigabbrev_np() is GNU only, provide a fallback function that
returns "SIG<signo>" when sigabbrev_np() doesn't exist (for example,
on FreeBSD).
This commit is contained in:
Daniel Eklöf 2025-07-21 15:28:52 +02:00
parent 7ab43ebf74
commit 21db6a6cdc
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 30 additions and 6 deletions

View file

@ -25,6 +25,12 @@ if cc.has_function('execvpe',
add_project_arguments('-DEXECVPE', language: 'c')
endif
if cc.has_function('sigabbrev_np',
args: ['-D_GNU_SOURCE'],
prefix: '#include <string.h>')
add_project_arguments('-DSIGABBREV_NP', language: 'c')
endif
utmp_backend = get_option('utmp-backend')
if utmp_backend == 'auto'
host_os = host_machine.system()