Message ID | 20240229122634.2619-1-dkirjanov@suse.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 67685422bfee1b886b907e03129b12c8a1ebb6a4 |
Delegated to: | Stephen Hemminger |
Headers | show |
Series | [iproute2,v3] ifstat: handle unlink return value | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
Hello: This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <stephen@networkplumber.org>: On Thu, 29 Feb 2024 07:26:34 -0500 you wrote: > Print an error message if we can't remove the history file > > v2: exit if unlink failed > v3: restore the changelog > > Signed-off-by: Denis Kirjanov <dkirjanov@suse.de> > > [...] Here is the summary with links: - [iproute2,v3] ifstat: handle unlink return value https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=67685422bfee You are awesome, thank you!
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;
Print an error message if we can't remove the history file v2: exit if unlink failed v3: restore the changelog Signed-off-by: Denis Kirjanov <dkirjanov@suse.de> --- misc/ifstat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)