#4968 added file descriptor check in IO#initialize.
It raises an exception at IO.open(0, "r") https://github.com/mruby/mruby/blob/master/mrbgems/mruby-io/mrblib/io.rb#L363 when a process is started as Windows service. Because a process started as Windows service doesn't have a valid standard input. fstat(0, buf) returns non-zero.
Here are solutions I think:
- Don't check file descriptor for
0, 1 and 2.
- Open an internal pipe for
0, 1 and 2 when they are invalid.
Which solution do you like?
I think that 1. is enough.
FYI: CRuby uses 2.: fill_standard_fds() https://github.com/ruby/ruby/blob/master/ruby.c#L2556-L2584
#4968 added file descriptor check in
IO#initialize.It raises an exception at
IO.open(0, "r")https://github.com/mruby/mruby/blob/master/mrbgems/mruby-io/mrblib/io.rb#L363 when a process is started as Windows service. Because a process started as Windows service doesn't have a valid standard input.fstat(0, buf)returns non-zero.Here are solutions I think:
0,1and2.0,1and2when they are invalid.Which solution do you like?
I think that 1. is enough.
FYI: CRuby uses 2.:
fill_standard_fds()https://github.com/ruby/ruby/blob/master/ruby.c#L2556-L2584