From 42ca978078e09eb7e0044d2d8453b1a9cb69d9fe Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 8 Jan 2021 18:07:57 +0100 Subject: [PATCH] alsactl: daemon - read_pid_file() fix the returned code on read error Signed-off-by: Jaroslav Kysela --- alsactl/daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alsactl/daemon.c b/alsactl/daemon.c index 65f7ac1..ee03991 100644 --- a/alsactl/daemon.c +++ b/alsactl/daemon.c @@ -284,7 +284,7 @@ static long read_pid_file(const char *pidfile) err = err < 0 ? -errno : -EIO; close(fd); pid_txt[11] = '\0'; - return atol(pid_txt); + return err < 0 ? err : atol(pid_txt); } else { return -errno; }