From 7fa6aafe51c40f155c040c743a860ed2c5349883 Mon Sep 17 00:00:00 2001 From: Charlie Somerville Date: Tue, 3 Dec 2013 15:14:09 +1100 Subject: [PATCH] exit with non-zero status if there are any errors --- script/doctor.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/doctor.rb b/script/doctor.rb index ea9b4ce..e8ffb95 100644 --- a/script/doctor.rb +++ b/script/doctor.rb @@ -14,9 +14,14 @@ symbols = `nm -gu #{ENV["SONAME"]} | grep -v GLIBC`.lines.map { |line| symbol } +errors = 0 + symbols.each do |symbol| `grep -qr #{symbol} /usr/include/nagios` next if $?.success? next if IGNORED_UNDEFINED_SYMBOLS.include?(symbol) + errors += 1 puts "Undefined symbol reference `#{symbol}' does not appear to belong to nagios." end + +exit errors.zero?