variable cannot be NULL so don't test for that

This commit is contained in:
sin 2014-04-18 09:30:48 +01:00
parent 2618410910
commit 8d92201170
1 changed files with 13 additions and 15 deletions

View File

@ -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);
}
}