8213017: jspawnhelper: need to handle pipe write failure when sending return code
authorstuefe
Fri, 26 Oct 2018 16:49:18 +0200
changeset 52327 6fe18b0c0e88
parent 52326 77018c2b97df
child 52328 16950b2eaebf
child 57010 026ac5eacc7c
8213017: jspawnhelper: need to handle pipe write failure when sending return code Reviewed-by: alanb
src/java.base/unix/native/jspawnhelper/jspawnhelper.c
--- a/src/java.base/unix/native/jspawnhelper/jspawnhelper.c	Tue Oct 30 09:34:50 2018 +0100
+++ b/src/java.base/unix/native/jspawnhelper/jspawnhelper.c	Fri Oct 26 16:49:18 2018 +0200
@@ -49,7 +49,10 @@
 #define ERR_ARGS 3
 
 void error (int fd, int err) {
-    write (fd, &err, sizeof(err));
+    if (write (fd, &err, sizeof(err)) != sizeof(err)) {
+        /* Not sure what to do here. I have no one to speak to. */
+        exit(0x80 + err);
+    }
     exit (1);
 }