[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2aa3a4f7-4b09-488f-9ae6-2e61dd1dfe8d@suse.de>
Date: Thu, 29 Feb 2024 15:26:49 +0300
From: Denis Kirjanov <dkirjanov@...e.de>
To: Denis Kirjanov <kirjanov@...il.com>, stephen@...workplumber.org
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 v2] ifstat: handle unlink return value
On 2/29/24 15:22, Denis Kirjanov wrote:
> v2: exit if unlink failed
please ignore
> Signed-off-by: Denis Kirjanov <dkirjanov@...e.de>
> ---
> misc/ifstat.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/misc/ifstat.c b/misc/ifstat.c
> index 767cedd4..72901097 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;
Powered by blists - more mailing lists