Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure Agent is running before accessing constants for it. Fixes #1698.

  • Loading branch information...
commit cb98d7a5e3a9be1ac8591eb0b44e9975337cb4fa 1 parent e714c68
@brixen brixen authored
View
6 kernel/bootstrap/rubinius.rb
@@ -99,9 +99,9 @@ def self.get_user_home(name)
raise PrimitiveFailure, "Rubinius.get_user_home failed"
end
- def self.agent_io
- Rubinius.primitive :vm_agent_io
- raise PrimitiveFailure, "Rubinius.agent_io failed"
+ def self.agent_loopback
+ Rubinius.primitive :vm_agent_loopback
+ raise PrimitiveFailure, "Rubinius.agent_loopback failed"
end
def self.lock(obj)
View
3  lib/rubinius/agent.rb
@@ -9,8 +9,9 @@ def self.connect(host, port, &b)
end
def self.loopback
+ lo = new Rubinius.agent_loopback
Rubinius::AgentRegistry.spawn_thread
- new Rubinius.agent_io
+ lo
end
def initialize(io, password=nil)
View
3  vm/builtin/system.cpp
@@ -1340,8 +1340,9 @@ namespace rubinius {
#endif
}
- IO* System::vm_agent_io(STATE) {
+ IO* System::vm_agent_loopback(STATE) {
QueryAgent* agent = state->shared().autostart_agent(state);
+
int sock = agent->loopback_socket();
if(sock < 0) {
if(!agent->setup_local()) return nil<IO>();
View
4 vm/builtin/system.hpp
@@ -287,8 +287,8 @@ namespace rubinius {
// Rubinius.primitive :vm_get_user_home
static String* vm_get_user_home(STATE, String* name);
- // Rubinius.primitive :vm_agent_io
- static IO* vm_agent_io(STATE);
+ // Rubinius.primitive :vm_agent_loopback
+ static IO* vm_agent_loopback(STATE);
// Rubinius.primitive :vm_dump_heap
static Object* vm_dump_heap(STATE, String* path);
Please sign in to comment.
Something went wrong with that request. Please try again.