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];
|
||||
|
||||
if (variable) {
|
||||
if (value) {
|
||||
if (setsysctl(variable, value) < 0) {
|
||||
r = EXIT_FAILURE;
|
||||
weprintf("failed to set sysctl for %s\n", variable);
|
||||
continue;
|
||||
}
|
||||
if (value) {
|
||||
if (setsysctl(variable, value) < 0) {
|
||||
r = EXIT_FAILURE;
|
||||
weprintf("failed to set sysctl for %s\n", variable);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if (getsysctl(variable, &value) < 0) {
|
||||
r = EXIT_FAILURE;
|
||||
weprintf("failed to get sysctl for %s\n", variable);
|
||||
continue;
|
||||
}
|
||||
printf("%s = %s\n", variable, value);
|
||||
free(value);
|
||||
}
|
||||
else {
|
||||
if (getsysctl(variable, &value) < 0) {
|
||||
r = EXIT_FAILURE;
|
||||
weprintf("failed to get sysctl for %s\n", variable);
|
||||
continue;
|
||||
}
|
||||
printf("%s = %s\n", variable, value);
|
||||
free(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user