projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e5385b
)
networkctl: use parse_ifindex_or_ifname()
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Wed, 29 May 2019 02:02:09 +0000
(11:02 +0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Wed, 29 May 2019 04:22:01 +0000
(13:22 +0900)
src/network/networkctl.c
patch
|
blob
|
history
diff --git
a/src/network/networkctl.c
b/src/network/networkctl.c
index
5e30959
..
321fe92
100644
(file)
--- a/
src/network/networkctl.c
+++ b/
src/network/networkctl.c
@@
-1089,12
+1089,9
@@
static int link_delete(int argc, char *argv[], void *userdata) {
return log_oom();
for (i = 1; i < argc; i++) {
- r = parse_ifindex(argv[i], &index);
- if (r < 0) {
- index = (int) if_nametoindex(argv[i]);
- if (index <= 0)
- return log_error_errno(r, "Failed to resolve interface %s", argv[i]);
- }
+ r = parse_ifindex_or_ifname(argv[i], &index);
+ if (r < 0)
+ return log_error_errno(r, "Failed to resolve interface %s", argv[i]);
r = set_put(indexes, INT_TO_PTR(index));
if (r < 0)