Skip to content

Commit

Permalink
Merge pull request #965 from frenkel/patch-1
Browse files Browse the repository at this point in the history
Silence stderr output on *BSD
  • Loading branch information
fallwith authored Feb 22, 2022
2 parents 0cfac1e + aacb186 commit 94480a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/new_relic/agent/hostname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def self.get
# we get back empty string. So, solution here is to check for non-zero
# exit status and retry the command without the -f flag.
def self.get_fqdn
fqdn = %x(hostname -f).chomp!
fqdn = %x(hostname -f 2>/dev/null).chomp!
fqdn = %x(hostname).chomp! unless $?.exitstatus.zero?
fqdn
rescue => e
Expand Down

0 comments on commit 94480a7

Please sign in to comment.