1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

smart_: port to openbsd & macos

This commit is contained in:
Steve Schnepp 2021-02-07 12:19:39 +01:00
parent 6eff786eef
commit b86f1d0ffe

View file

@ -107,7 +107,10 @@ int main(int argc, char **argv)
} }
/* Close command (this is where we get the exit code! */ /* Close command (this is where we get the exit code! */
i = WEXITSTATUS(pclose(f)); {
int status = pclose(f); /* using an explicit temp var, to be compatible with macos & openbsd */
i = WEXITSTATUS(status);
}
if (i == 1 || /* smartctl command did not parse */ if (i == 1 || /* smartctl command did not parse */
/*i == 2 || *//* smartctl device open failed */ /*i == 2 || *//* smartctl device open failed */
i == 127) { /* command not found */ i == 127) { /* command not found */