* [PATCH] iproute: print more verbose error on route cache flush
@ 2015-09-05 7:40 Denis Kirjanov
2015-09-07 18:10 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Denis Kirjanov @ 2015-09-05 7:40 UTC (permalink / raw)
To: stephen; +Cc: netdev, Denis Kirjanov
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 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 8f49e62..abe4180 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;
}
--
2.4.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iproute: print more verbose error on route cache flush
2015-09-05 7:40 [PATCH] iproute: print more verbose error on route cache flush Denis Kirjanov
@ 2015-09-07 18:10 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2015-09-07 18:10 UTC (permalink / raw)
To: Denis Kirjanov; +Cc: netdev
On Sat, 5 Sep 2015 10:40:50 +0300
Denis Kirjanov <kda@linux-powerpc.org> wrote:
> 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 | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ip/iproute.c b/ip/iproute.c
> index 8f49e62..abe4180 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;
> }
>
Sure why not, applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-07 18:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-05 7:40 [PATCH] iproute: print more verbose error on route cache flush Denis Kirjanov
2015-09-07 18:10 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).