iproute2: bridge: Close file with bridge monitor file
The `bridge monitor file FILENAME' reads dumped netlink messages from a file. But it forgot to close the file after using it. This patch fixes it. Signed-off-by: Petr Písař <ppisar@redhat.com>
This commit is contained in:
parent
f3abcfed46
commit
101847446e
|
|
@ -132,12 +132,15 @@ int do_monitor(int argc, char **argv)
|
|||
|
||||
if (file) {
|
||||
FILE *fp;
|
||||
int err;
|
||||
fp = fopen(file, "r");
|
||||
if (fp == NULL) {
|
||||
perror("Cannot fopen");
|
||||
exit(-1);
|
||||
}
|
||||
return rtnl_from_file(fp, accept_msg, stdout);
|
||||
err = rtnl_from_file(fp, accept_msg, stdout);
|
||||
fclose(fp);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (rtnl_open(&rth, groups) < 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue