aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-12-05 12:46:05 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-12-05 12:46:05 +1300
commit57b722612775514ca6e3e4b67d8f547c6c0b47da (patch)
tree0540919ca6002cb5d601567af1666a644abf77be
parentFix up the test LRC a bit (diff)
downloadmpdlrc-57b722612775514ca6e3e4b67d8f547c6c0b47da.tar.gz
mpdlrc-57b722612775514ca6e3e4b67d8f547c6c0b47da.zip
Move child kill to the end of the loop
-rwxr-xr-xmpdlrc10
1 files changed, 5 insertions, 5 deletions
diff --git a/mpdlrc b/mpdlrc
index e59e6f5..4cb6884 100755
--- a/mpdlrc
+++ b/mpdlrc
@@ -44,11 +44,6 @@ binmode *STDOUT, ':encoding(utf8)';
MPD: while (1) {
- # Something important happened; kill any running lyric processes
- if ($pid) {
- kill 'INT', $pid;
- }
-
# Get the current status
my $status = $mpd->update_status();
@@ -91,6 +86,11 @@ MPD: while (1) {
# Wait for something else to happen to the player, whether or not there's a
# forked process going
$mpd->idle('player');
+
+ # Something important happened; kill any running lyric processes
+ if ($pid) {
+ kill 'INT', $pid;
+ }
}
# Subroutine to read lyrics from the given filename and return a queue object