passt: Check if a PID file was actually requested before creating it

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-15 20:40:56 +02:00
parent 955fe812dc
commit bd47b68ebf

View file

@ -248,7 +248,7 @@ static void pid_file(struct ctx *c) {
char pid_buf[12]; char pid_buf[12];
int pid_fd, n; int pid_fd, n;
if (!c->pid_file) if (!*c->pid_file)
return; return;
pid_fd = open(c->pid_file, O_CREAT | O_WRONLY); pid_fd = open(c->pid_file, O_CREAT | O_WRONLY);