mirror of
https://github.com/systemd/systemd.git
synced 2024-10-30 23:21:22 +03:00
resolve-tool: trivial coding style improvements
This commit is contained in:
parent
ae934a7325
commit
27d8af3e39
@ -88,7 +88,7 @@ static char *arg_set_dnssec = NULL;
|
||||
static char **arg_set_nta = NULL;
|
||||
|
||||
static ServiceFamily service_family_from_string(const char *s) {
|
||||
if (s == NULL || streq(s, "tcp"))
|
||||
if (!s || streq(s, "tcp"))
|
||||
return SERVICE_FAMILY_TCP;
|
||||
if (streq(s, "udp"))
|
||||
return SERVICE_FAMILY_UDP;
|
||||
@ -1940,12 +1940,10 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
arg_family = AF_INET6;
|
||||
break;
|
||||
|
||||
case 'i': {
|
||||
int ifi;
|
||||
case 'i':
|
||||
if (parse_ifindex(optarg, &arg_ifindex) < 0) {
|
||||
int ifi;
|
||||
|
||||
if (parse_ifindex(optarg, &ifi) >= 0)
|
||||
arg_ifindex = ifi;
|
||||
else {
|
||||
ifi = if_nametoindex(optarg);
|
||||
if (ifi <= 0)
|
||||
return log_error_errno(errno, "Unknown interface %s: %m", optarg);
|
||||
@ -1954,7 +1952,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 't':
|
||||
if (streq(optarg, "help")) {
|
||||
@ -2415,7 +2412,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case MODE_SET_LINK:
|
||||
if (argc > optind) {
|
||||
log_error("Too many arguments.");
|
||||
|
Loading…
Reference in New Issue
Block a user