commit d2149b0810530c02243d7d6c68d1d47b3b8364b7
parent 2bdaabf6f9f3e647b520e0ad7898ab0fb7b17c27
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 30 Jun 2021 00:03:25 -0700
Fix pupdate
When the player was stopped the state was erronously set to zero.
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/aps/player.c b/aps/player.c
@@ -115,10 +115,12 @@ void
pupdate(struct player *p, int status)
{
if (WIFEXITED(status) || WIFSIGNALED(status)) {
- if (WIFEXITED(status) && p->state != STOPPED)
- p->state = WEXITSTATUS(status) ? FAILURE : 0;
- else
- p->state = 0;
+ if (p->state != STOPPED) {
+ if (WIFEXITED(status) && WEXITSTATUS(status))
+ p->state = FAILURE;
+ else
+ p->state = 0;
+ }
} else if (WIFCONTINUED(status)) {
p->state = RUNNING;
} else if (WIFSTOPPED(status)) {