lib/syslogstash/syslog_reader.rb in syslogstash-0.1.4 vs lib/syslogstash/syslog_reader.rb in syslogstash-0.1.5
- old
+ new
@@ -18,11 +18,11 @@
begin
socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0)
socket.bind(Socket.pack_sockaddr_un(@file))
rescue Errno::EEXIST, Errno::EADDRINUSE
- log { "socket file #{@file} already exists; deleting"
+ log { "socket file #{@file} already exists; deleting" }
File.unlink(@file) rescue nil
retry
rescue SystemCallError
$stderr.puts "Error while trying to bind to #{@file}"
raise
@@ -35,10 +35,10 @@
debug { "Message received: #{msg.inspect}" }
process_message msg.first.chomp
end
ensure
socket.close
- log { "removing socket file #{@file}"
+ log { "removing socket file #{@file}" }
File.unlink(@file) rescue nil
end
end
end