Skip to content

Commit

Permalink
Try another work around for the sys-uname msvcrt.dll ffi error that h…
Browse files Browse the repository at this point in the history
…appens on startup
  • Loading branch information
jordansissel committed Feb 8, 2013
1 parent d173acd commit 827d087
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/logstash/util.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
require "logstash/namespace"
require "ffi" # gem ffi
require "sys/uname" # gem sys-uname

module LogStash::Util
PR_SET_NAME = 15

# This can throw an exception, if it does, we're probably not
# on linux.
UNAME = Sys::Uname.uname.sysname rescue "unknown"
# This can throw an exception, if it does, we're probably not on linux.
# It certainly throws an exception on Windows; I don't know how
# to work around it other than this hack.
begin
require "sys/uname" # gem sys-uname
UNAME = Sys::Uname.uname.sysname
rescue LoadError, NotFoundError
UNAME = "unknown"
end

module LibC
extend FFI::Library
Expand Down

0 comments on commit 827d087

Please sign in to comment.