alsactl: daemon - read_pid_file() fix the returned code on read error

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-01-08 18:07:57 +01:00
parent 05ebe64b2d
commit 42ca978078

View file

@ -284,7 +284,7 @@ static long read_pid_file(const char *pidfile)
err = err < 0 ? -errno : -EIO; err = err < 0 ? -errno : -EIO;
close(fd); close(fd);
pid_txt[11] = '\0'; pid_txt[11] = '\0';
return atol(pid_txt); return err < 0 ? err : atol(pid_txt);
} else { } else {
return -errno; return -errno;
} }