Fix lsb_release/sw_vers errors on NetBSD

fixes #4779
This commit is contained in:
Edgar Fuß 2017-02-08 17:45:38 +01:00 committed by Michael Friedrich
parent 905f208332
commit 7414df4ef8
2 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,7 @@ David Beck <techiscool@gmail.com>
Dinesh Majrekar <dinesh.majrekar@serverchoice.com> Dinesh Majrekar <dinesh.majrekar@serverchoice.com>
Dirk Goetz <dirk.goetz@icinga.com> Dirk Goetz <dirk.goetz@icinga.com>
Dolf Schimmel <dolf@transip.nl> Dolf Schimmel <dolf@transip.nl>
Edgar Fuß <ef@math.uni-bonn.de>
Eduard Güldner <eduard.gueldner@gmail.com> Eduard Güldner <eduard.gueldner@gmail.com>
Edvin Seferovic <edvin@seferovic.net> Edvin Seferovic <edvin@seferovic.net>
Eric Lippmann <eric.lippmann@icinga.com> Eric Lippmann <eric.lippmann@icinga.com>

View File

@ -1556,7 +1556,7 @@ static bool ReleaseHelper(String *platformName, String *platformVersion)
} }
/* You are using a distribution which supports LSB. */ /* You are using a distribution which supports LSB. */
FILE *fp = popen("lsb_release -s -i 2>&1", "r"); FILE *fp = popen("type lsb_release >/dev/null 2>&1 && lsb_release -s -i 2>&1", "r");
if (fp != NULL) { if (fp != NULL) {
std::ostringstream msgbuf; std::ostringstream msgbuf;
@ -1570,7 +1570,7 @@ static bool ReleaseHelper(String *platformName, String *platformVersion)
} }
} }
fp = popen("lsb_release -s -r 2>&1", "r"); fp = popen("type lsb_release >/dev/null 2>&1 && lsb_release -s -r 2>&1", "r");
if (fp != NULL) { if (fp != NULL) {
std::ostringstream msgbuf; std::ostringstream msgbuf;
@ -1585,7 +1585,7 @@ static bool ReleaseHelper(String *platformName, String *platformVersion)
} }
/* OS X */ /* OS X */
fp = popen("sw_vers -productName 2>&1", "r"); fp = popen("type sw_vers >/dev/null 2>&1 && sw_vers -productName 2>&1", "r");
if (fp != NULL) { if (fp != NULL) {
std::ostringstream msgbuf; std::ostringstream msgbuf;
@ -1602,7 +1602,7 @@ static bool ReleaseHelper(String *platformName, String *platformVersion)
} }
} }
fp = popen("sw_vers -productVersion 2>&1", "r"); fp = popen("type sw_vers >/dev/null 2>&1 && sw_vers -productVersion 2>&1", "r");
if (fp != NULL) { if (fp != NULL) {
std::ostringstream msgbuf; std::ostringstream msgbuf;