chiark / gitweb /
Fix bug that program_invocation_name is NULL when backgrounding
authorSven Eden <yamakuzure@gmx.net>
Sun, 12 Mar 2017 11:34:34 +0000 (12:34 +0100)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:23:22 +0000 (10:23 +0100)
commita56317566353ab14adc5f68da93af51d880b6ffd
tree6b4de762f36eba8adf95026b51396ac0e1c18871
parent34c7fcb14d705141c71b5b63a2f044a51ffbd92b
Fix bug that program_invocation_name is NULL when backgrounding

This is a weird issue. When elogind is started from a tty, everything
works just fine. But since adding the fixes to build elogind against
the musl libc, which does not provide program_invocation_name and
program_invocation_short_name, glibc does not set them when elogind
is background. Neither when done manually, nor when doing it using a
system init tool like openrc /sbin/start-stop-daemon.

The "workaround" is to allow elogind_set_program_name() to (re-)set
both globals if they are either NULL, or not set to the correct
value.

This should work fine with both glibc and musl-libc.
src/basic/musl_missing.c