Download raw body.
x11/i3status: Recover from sndiod restart
On occasion I restart sndiod which causes i3status to stop reporting the
volume level. The below patch resets initialized after a disconnect so
on the next poll i3status will attempt to reconnect to the new sndiod.
I opted against resetting initialized in cleanup so a failure in init
won't be retried.
diff --git patches/patch-src_sndio_c patches/patch-src_sndio_c
index 1918558bf36..dd4e81598a0 100644
--- patches/patch-src_sndio_c
+++ patches/patch-src_sndio_c
@@ -3,7 +3,7 @@ Add sndio volume backend.
Index: src/sndio.c
--- src/sndio.c.orig
+++ src/sndio.c
-@@ -0,0 +1,201 @@
+@@ -0,0 +1,202 @@
+#include <poll.h>
+#include <sndio.h>
+#include <stdio.h>
@@ -183,6 +183,7 @@ Index: src/sndio.c
+ if (sioctl_revents(hdl, pfds) & POLLHUP) {
+ fprintf(stderr, "sndio: disconnected\n");
+ cleanup();
++ initialized = 0;
+ return -1;
+ }
+ }
x11/i3status: Recover from sndiod restart