From patchwork Sat Sep 5 07:40:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kirjanov X-Patchwork-Id: 514804 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A30DB140284 for ; Sat, 5 Sep 2015 18:19:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750846AbbIEITH (ORCPT ); Sat, 5 Sep 2015 04:19:07 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:33700 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbbIEITA (ORCPT ); Sat, 5 Sep 2015 04:19:00 -0400 Received: by lbcjc2 with SMTP id jc2so21338615lbc.0 for ; Sat, 05 Sep 2015 01:18:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fk10Ub96VKm8kw4pTOQVyOYK5/r//PWlDnTlYXAqOhc=; b=lnfqwtL0MPvHWUtzTg12wSAjQyKE5yNStIG7RT0NavdJykz+uKP3iR3kYodYaoKja3 wcRcfBZ7l6jJ5RlRjxnzS8/kTxSTOsi/tEGq3axeGLdLvEwB9LfBUo820v+Rhy9Zmyfo 3yfx/IKUfwSl+EMuHmrUV7ebz2wC81E6CY+BVQuD5Lv1k25+NACvBMrkMf529YONyAuz kOHJUuXGEi0pyGYD19SmoigWOt8rqI5eCuWu4aUJMoEvXVXNDkTmLxcezg0uFcPUU+L4 V9y6260fZKi0XY+tERDiNJT15LKeOrVjISA7qbNnQgCZycm/HhSCPN1VZ1BlGuCx8L5G qdWA== X-Gm-Message-State: ALoCoQmUjl1SCqzUUF+TAY26UuR/XnvSf2KoOfSgkMemfD+CicPg0VU8BUdaOwj+M+u9krDDlQTt X-Received: by 10.112.149.68 with SMTP id ty4mr2539111lbb.74.1441441138777; Sat, 05 Sep 2015 01:18:58 -0700 (PDT) Received: from hydra.kdaintranet ([5.35.73.89]) by smtp.gmail.com with ESMTPSA id ok2sm1189394lbb.0.2015.09.05.01.18.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Sep 2015 01:18:58 -0700 (PDT) From: Denis Kirjanov To: stephen@networkplumber.org Cc: netdev@vger.kernel.org, Denis Kirjanov Subject: [PATCH] iproute: print more verbose error on route cache flush Date: Sat, 5 Sep 2015 10:40:50 +0300 Message-Id: <1441438850-4793-1-git-send-email-kda@linux-powerpc.org> X-Mailer: git-send-email 2.4.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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; }