Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENXIO raised when hashing UNIX domain socket file #64

Merged
merged 1 commit into from
Oct 3, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/listen/directory_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions spec/listen/directory_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down