variable cannot be NULL so don't test for that
This commit is contained in:
parent
2618410910
commit
8d92201170
28
sysctl.c
28
sysctl.c
@ -154,23 +154,21 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
variable = argv[i];
|
variable = argv[i];
|
||||||
|
|
||||||
if (variable) {
|
if (value) {
|
||||||
if (value) {
|
if (setsysctl(variable, value) < 0) {
|
||||||
if (setsysctl(variable, value) < 0) {
|
r = EXIT_FAILURE;
|
||||||
r = EXIT_FAILURE;
|
weprintf("failed to set sysctl for %s\n", variable);
|
||||||
weprintf("failed to set sysctl for %s\n", variable);
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
if (getsysctl(variable, &value) < 0) {
|
else {
|
||||||
r = EXIT_FAILURE;
|
if (getsysctl(variable, &value) < 0) {
|
||||||
weprintf("failed to get sysctl for %s\n", variable);
|
r = EXIT_FAILURE;
|
||||||
continue;
|
weprintf("failed to get sysctl for %s\n", variable);
|
||||||
}
|
continue;
|
||||||
printf("%s = %s\n", variable, value);
|
|
||||||
free(value);
|
|
||||||
}
|
}
|
||||||
|
printf("%s = %s\n", variable, value);
|
||||||
|
free(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user