/* Then, add process if set */
if (read_process(&buf, &iovec[i]) > 0)
i++;
- else if (ucred && get_process_name(ucred->pid, &process) >= 0)
+ else if (ucred &&
+ ucred->pid > 0 &&
+ get_process_name(ucred->pid, &process) >= 0)
IOVEC_SET_STRING(iovec[i++], process);
/* Skip the stored PID if we have a better one */
return -errno;
}
- get_process_name(sfsi.ssi_pid, &p);
+ if (sfsi.ssi_pid > 0)
+ get_process_name(sfsi.ssi_pid, &p);
+
log_debug("Received SIG%s from PID %lu (%s)",
strna(signal_to_string(sfsi.ssi_signo)),
(unsigned long) sfsi.ssi_pid, strna(p));