From: Denis Kirjanov Date: Sat, 5 Sep 2015 07:40:50 +0000 (+0300) Subject: iproute: print more verbose error on route cache flush X-Git-Tag: v4.3.0~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9827fa57da0ee93b7573fd13865c56ab3c34afc8;p=thirdparty%2Fiproute2.git 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 --- diff --git a/ip/iproute.c b/ip/iproute.c index 8f49e6289..abe41803e 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -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; }