unix_listener_stats follows and remembers symlinks
commitbd7236fe23c4388d2fa42a4f836aca3c796dabab
authorEric Wong <normalperson@yhbt.net>
Wed, 6 Jun 2012 00:49:43 +0000 (5 17:49 -0700)
committerEric Wong <normalperson@yhbt.net>
Wed, 6 Jun 2012 00:49:43 +0000 (5 17:49 -0700)
tree68c40ff04e15853d12138d06a34dbb73a3e1389b
parent15dea14dd4e1af97aef928430c3c8ef8c5d74451
unix_listener_stats follows and remembers symlinks

Teach unix_listener_stats to remember the symlink path
it followed and have it point to the same object as the
resolved (real) socket path.

This allows the case where looking up stats by symlinks
works if the symlink is given to unix_listener_stats:

  File.symlink("/real/path/of.sock", "/path/to/link.sock")
  stats = unix_listener_stats(["/path/to/link.sock"])
  stats["/path/to/link.sock"] => # same as stats["/real/path/of.sock"]
lib/raindrops/linux.rb
test/test_linux.rb