Fix init(8) setenv READYFD error handling.

This commit is contained in:
Jonas 'Sortie' Termansen 2024-08-21 16:35:26 +02:00
parent 89c6f81045
commit 2bf97e0439

View file

@ -2204,7 +2204,7 @@ static void daemon_start(struct daemon* daemon)
// this daemon.
char ppid_str[sizeof(pid_t) * 3];
snprintf(ppid_str, sizeof(ppid_str), "%" PRIiPID, ppid);
if ( (!daemon->need_tty && setenv("READYFD", "3", 1)) < 0 ||
if ( (!daemon->need_tty && setenv("READYFD", "3", 1) < 0) ||
setenv("INIT_PID", ppid_str, 1) < 0 ||
setenv("LOGNAME", pwd->pw_name, 1) < 0 ||
setenv("USER", pwd->pw_name, 1) < 0 ||