Permalink
Browse files

ENXIO raised when hashing UNIX domain socket file

  • Loading branch information...
1 parent d38437c commit e5152b09b7c37e6dd15836164c7d1f208fa30ce8 @sunaku sunaku committed Sep 27, 2012
Showing with 11 additions and 1 deletion.
  1. +1 −1 lib/listen/directory_record.rb
  2. +10 −0 spec/listen/directory_record_spec.rb
@@ -282,7 +282,7 @@ def insert_sha1_checksum(path)
#
def sha1_checksum(path)
Digest::SHA1.file(path).to_s
- rescue Errno::EACCES, Errno::ENOENT
+ rescue Errno::EACCES, Errno::ENOENT, Errno::ENXIO
nil
end
@@ -1161,6 +1161,16 @@
end
end
+ context 'within a directory containing a unix domain socket file' do
+ it 'does not raise an exception when hashing a unix domain socket file' do
+ fixtures do |path|
+ require 'socket'
+ UNIXServer.new('unix_domain_socket.sock')
+ lambda { changes(path){} }.should_not raise_error(Errno::ENXIO)
+ end
+ end
+ end
+
context 'with symlinks', :unless => windows? do
it 'looks at symlinks not their targets' do
fixtures do |path|

0 comments on commit e5152b0

Please sign in to comment.