From: Stephen Hemminger <stephen@networkplumber.org>
To: Denis Kirjanov <kirjanov@gmail.com>
Cc: netdev@vger.kernel.org, Denis Kirjanov <dkirjanov@suse.de>
Subject: Re: [PATCH iproute2] ifstat: handle unlink return value
Date: Wed, 28 Feb 2024 16:51:33 -0800 [thread overview]
Message-ID: <20240228165133.1799deab@hermes.local> (raw)
In-Reply-To: <20240221120424.3221-1-dkirjanov@suse.de>
On Wed, 21 Feb 2024 07:04:24 -0500
Denis Kirjanov <kirjanov@gmail.com> wrote:
> Print an error message if we can't remove the history file
>
> Signed-off-by: Denis Kirjanov <dkirjanov@suse.de>
> ---
Good idea, but would like the output and result to look like
the other errors in ifstat about history file. Something like:
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 767cedd4aa47..72901097e6c2 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -937,8 +937,10 @@ int main(int argc, char *argv[])
"%s/.%s_ifstat.u%d", P_tmpdir, stats_type,
getuid());
- if (reset_history)
- unlink(hist_name);
+ if (reset_history && unlink(hist_name) < 0) {
+ perror("ifstat: unlink history file");
+ exit(-1);
+ }
if (!ignore_history || !no_update) {
struct stat stb;
prev parent reply other threads:[~2024-02-29 0:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 12:04 [PATCH iproute2] ifstat: handle unlink return value Denis Kirjanov
2024-02-29 0:51 ` Stephen Hemminger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240228165133.1799deab@hermes.local \
--to=stephen@networkplumber.org \
--cc=dkirjanov@suse.de \
--cc=kirjanov@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.