« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--socat.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/socat.js b/socat.js
index 95ee889..8871c7e 100644
--- a/socat.js
+++ b/socat.js
@@ -30,6 +30,9 @@ module.exports = class Socat extends EventEmitter {
       this.subprocess.on('close', () => {
         this.subprocess = null
       })
+      this.subprocess.stdin.on('error', err => {
+        this.stop()
+      })
     }
   }
 
@@ -62,7 +65,7 @@ module.exports = class Socat extends EventEmitter {
         // or pipe we're writing to could have closed unexpectedly. If that
         // happens, unestablish the socat process; it'll try to reconnect if
         // we send another message.
-        this.stop();
+        this.stop()
       }
     } else {
       try {