[ruby-core:88320] Re: [Ruby trunk Bug#14968] [PATCH] io.c: make all pipes nonblocking by default

From: Eric Wong <normalperson@...>
Date: 2018-08-07 04:07:09 UTC
List: ruby-core #88320
[email protected] wrote:
> All of the test-all failures show something similar to:
> ```
> [Errno::ENOENT] exception expected, not.
> Class: <Errno::EBADF>
> ```

Thanks Greg.  The following patch (on top of my previous one) might
fix it, but it's a bit dirty.   No rush to try it.

```
--- a/process.c
+++ b/process.c
@@ -3454,7 +3454,11 @@ rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp,
             rb_execarg_allocate_dup2_tmpbuf(sargp, RARRAY_LEN(ary));
         }
     }
-    stdfd_clear_nonblock();
+    {
+        int preserve = errno;
+        stdfd_clear_nonblock();
+        errno = preserve;
+    }
 
     return 0;
 }
```
> 13 Total Failures/Errors                           Build No 1032    Job Id pwyhyvkao2nssxy1

Anyways, it doesn't seem like the problems from moving from
blocking to non-blocking pipes by default are insurmountable
and it's another step towards getting lightweight concurrency
into Ruby.

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next