« get me outta code hell

be even more careful with socat - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/socat.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-04-16 16:50:22 -0300
committerFlorrie <towerofnix@gmail.com>2020-04-16 16:50:22 -0300
commit17963e2e9f3bf99f2b261cd522e5b6d5ad053171 (patch)
tree92277df20eb01d98011a478f55e4b8793d4b74fe /socat.js
parent204368aedc92b54b15b0ef2790925f9b7755d0e0 (diff)
be even more careful with socat
Diffstat (limited to 'socat.js')
-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 {