iproute: print more verbose error on route cache flush

Before:
kda@vfirst ~/devel/iproute2 $ ./ip/ip route flush cache
Cannot open "/proc/sys/net/ipv4/route/flush"

After:
kda@vfirst ~/devel/iproute2/ip $ ./ip route flush cache
Cannot open "/proc/sys/net/ipv4/route/flush": Permission denied

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
This commit is contained in:
Denis Kirjanov 2015-09-05 10:40:50 +03:00 committed by Stephen Hemminger
parent 1eea5c46ec
commit 9827fa57da
1 changed files with 2 additions and 1 deletions

View File

@ -1213,7 +1213,8 @@ static int iproute_flush_cache(void)
char *buffer = "-1";
if (flush_fd < 0) {
fprintf (stderr, "Cannot open \"%s\"\n", ROUTE_FLUSH_PATH);
fprintf (stderr, "Cannot open \"%s\": %s\n",
ROUTE_FLUSH_PATH, strerror(errno));
return -1;
}