Commit 10184744 authored by Petr Písař's avatar Petr Písař Committed by Stephen Hemminger

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: default avatarPetr Písař <ppisar@redhat.com>
parent f3abcfed
...@@ -132,12 +132,15 @@ int do_monitor(int argc, char **argv) ...@@ -132,12 +132,15 @@ int do_monitor(int argc, char **argv)
if (file) { if (file) {
FILE *fp; FILE *fp;
int err;
fp = fopen(file, "r"); fp = fopen(file, "r");
if (fp == NULL) { if (fp == NULL) {
perror("Cannot fopen"); perror("Cannot fopen");
exit(-1); 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) if (rtnl_open(&rth, groups) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment