chiark / gitweb /
bin/disorder-notify: Don't fork on an explicit `watch' request.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 2 Jun 2020 09:58:48 +0000 (10:58 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 2 Jun 2020 16:20:38 +0000 (17:20 +0100)
bin/disorder-notify

index b2967e2a53f7d1e7af82403e96a0aae035d07761..c68e50c9fd7240bd8ccfa70421699d16b718d98e 100755 (executable)
@@ -222,7 +222,6 @@ sub watch_and_notify0 ($) {
 sub watch_and_notify ($) {
   my ($now_playing) = @_;
 
-  fork and exit 0;
   claim_lock or exit 1;
 
   for (;;) {
@@ -290,7 +289,10 @@ $OP{"notify-now-playing"} = sub {
   my $info = get_now_playing $sk;
   close $sk;
   notify "$TITLE: Now playing", format_now_playing %$info;
-  defined locked_by or watch_and_notify 0;
+  unless (defined locked_by) {
+    fork and exit 0;
+    watch_and_notify 0;
+  }
 };
 
 $OP{"next-config"} = sub {