]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iproute: print more verbose error on route cache flush
authorDenis Kirjanov <kda@linux-powerpc.org>
Sat, 5 Sep 2015 07:40:50 +0000 (10:40 +0300)
committerStephen Hemminger <shemming@brocade.com>
Mon, 7 Sep 2015 18:10:22 +0000 (11:10 -0700)
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>
ip/iproute.c

index 8f49e6289003e706d683e20ecaa8ebd2addff74a..abe41803e251615bddc504b0a5395b9a23a8b743 100644 (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;
        }