resolve symlinks to Unix domain sockets
commit15dea14dd4e1af97aef928430c3c8ef8c5d74451
authorBrian Corrigan <brian@genexp.me>
Tue, 5 Jun 2012 15:46:34 +0000 (5 11:46 -0400)
committerEric Wong <normalperson@yhbt.net>
Wed, 6 Jun 2012 00:16:38 +0000 (5 17:16 -0700)
tree4f0af6016b8ee1914f9a41933c9ea391c8649a24
parent3a7387205dd5791a443215ae6b365865e0eacfa3
resolve symlinks to Unix domain sockets

Raindrops currently fails when provided a symlink to a socket.
As this is a common practice for many deployment tools (Vlad,
etc.) this patch adds support for finding the realpath prior to
looking the socket up in /proc/net/unix

[ew: commit message subject]

[ew: fixed test to pass under 1.9.3 and 1.8.7:
* Tempfile#unlink is unsafe to call if we want to reuse the
  path, use File.unlink(tmp.path) instead

* The return value of File.symlink is zero (or it raises),
  so it's unusable.

* File.symlink will not call #to_path under 1.8.7, so it's
  necessary to pass pathnames to it, not Tempfile objects.
]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
lib/raindrops/linux.rb
test/test_linux.rb