about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-10-13 01:38:24 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-13 01:38:24 +0000
commit36d6b71a4bcf476f3acda6b249486844d76128ef (patch)
treee24f45a426e4cc2a80eca2a6cfe23eaed5d36ccc
parentf4dcfabd826ce8a43b9d4c41706fa8b95fb81acd (diff)
downloaddtas-36d6b71a4bcf476f3acda6b249486844d76128ef.tar.gz
This is to be compatible with Rubinius, but also works with MRI.
-rw-r--r--lib/dtas/unix_client.rb2
-rw-r--r--lib/dtas/unix_server.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/dtas/unix_client.rb b/lib/dtas/unix_client.rb
index fa8b11c..dfde59b 100644
--- a/lib/dtas/unix_client.rb
+++ b/lib/dtas/unix_client.rb
@@ -17,7 +17,7 @@ class DTAS::UNIXClient # :nodoc:
   end
 
   def initialize(path = self.class.default_path)
-    @to_io = Socket.new(:AF_UNIX, :SOCK_SEQPACKET, 0)
+    @to_io = Socket.new(:UNIX, :SEQPACKET, 0)
     @to_io.connect(Socket.pack_sockaddr_un(path))
   end
 
diff --git a/lib/dtas/unix_server.rb b/lib/dtas/unix_server.rb
index bccfad5..21261d3 100644
--- a/lib/dtas/unix_server.rb
+++ b/lib/dtas/unix_server.rb
@@ -26,13 +26,13 @@ class DTAS::UNIXServer # :nodoc:
     # lock down access by default, arbitrary commands may run as the
     # same user dtas-player runs as:
     old_umask = File.umask(0077)
-    @to_io = Socket.new(:AF_UNIX, :SOCK_SEQPACKET, 0)
+    @to_io = Socket.new(:UNIX, :SEQPACKET, 0)
     addr = Socket.pack_sockaddr_un(path)
     begin
       @to_io.bind(addr)
     rescue Errno::EADDRINUSE
       # maybe we have an old path leftover from a killed process
-      tmp = Socket.new(:AF_UNIX, :SOCK_SEQPACKET, 0)
+      tmp = Socket.new(:UNIX, :SEQPACKET, 0)
       begin
         tmp.connect(addr)
         raise RuntimeError, "socket `#{path}' is in use", []