Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.8, JRuby 0.9.9, JRuby 1.0.0RC1, JRuby 1.0.0RC2
-
Fix Version/s: JRuby 1.0.0RC3
-
Component/s: None
-
Labels:None
-
Environment:jruby from trunk 16. April, java 1.5.0_11, win xp sp 2
-
Number of attachments :
Description
JRuby seems to give 0 as process exit status even if it wasn't. Try this:
C:\>jruby -e "system('ruby -e \"exit(2)\"');print $?>>8"
0
This is a jruby issue, since
C:\>ruby -e "system('ruby -e \"exit(2)\"');print $?>>8"
2
As a minor detail, jruby seems to be a little smarter when finding stuff to execute:
C:\>ruby -e "system('jruby -e \"exit(2)\"');print $?>>8"
-e:1: undefined method `>>' for nil:NilClass (NoMethodError)
i.e. "jruby" executable could not be found. However:
C:\>ruby -e "system('jruby.bat -e \"exit(2)\"');print $?>>8"
2
And jruby seems to be smart enough to find the .bat file even w/out the suffix:
C:\>jruby -e "system('jruby -e \"exit(2)\"');print $?>>8"
0
I assume the latter "smartness" isn't something you think we should make un-smart. Actually this is probably Java being smart for us, so I'm not sure we could dumb it down if we wanted to.
The process exit stuff should be fixed for sure though.