diff --git a/lib/listen/directory_record.rb b/lib/listen/directory_record.rb index 3f7020fd..3eb43e31 100644 --- a/lib/listen/directory_record.rb +++ b/lib/listen/directory_record.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 diff --git a/spec/listen/directory_record_spec.rb b/spec/listen/directory_record_spec.rb index 07ec215e..c76e9dd8 100644 --- a/spec/listen/directory_record_spec.rb +++ b/spec/listen/directory_record_spec.rb @@ -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|