commit f982bbb78de170b267a1f6947ef46c9d23af8049
parent 29e1bffc5cdb0bc79248e6a1cfe042fc933257ff
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 21 Jul 2021 21:50:53 -0700
Fix player stop function
Previously if the player was suspended no special treatment was
given, now it is continued before SIGTERM is sent. This prevents
players from sticking around unable to handle SIGTERM.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/aps/player.c b/aps/player.c
@@ -61,7 +61,9 @@ pstop(struct player *p)
errno = EALREADY;
return 1;
}
- if (p->state & (RUNNING | SUSPENDED))
+ if (p->state == SUSPENDED)
+ pcontinue(p);
+ if (p->state == RUNNING)
kill(p->pid, SIGTERM); /* errors unconsequential */
p->state = STOPPED;
return 0;