mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-14 13:33:50 +08:00
ctrl: Fix fd leak in ctrl_listen()
Use the same pattern for handling rtnl_listen() errors that is used across other iproute2 commands. All other commands exit with status of 2 if rtnl_listen fails. Reported-off-by: Maks Mishin <maks.mishinFZ@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
35c0215739
commit
f4dc6a784f
@ -334,8 +334,9 @@ static int ctrl_listen(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (rtnl_listen(&rth, print_ctrl, (void *) stdout) < 0)
|
||||
return -1;
|
||||
|
||||
exit(2);
|
||||
|
||||
rtnl_close(&rth);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user