ifstat: handle unlink return value
Subsystems (2)
PATCH v2 1/1 ifstat: handle unlink return value
v2: exit if unlink failed
Signed-off-by Denis Kirjanov <[email protected]>
--- misc/ifstat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
misc/ifstat.c +4 -2
@@ -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;
Signature · 1 line
2.30.2
Quoted 1 line · Denis Kirjanov
v2: exit if unlink failed
please ignore
Quoted 22 lines
Signed-off-by Denis Kirjanov <[email protected]>--- misc/ifstat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)misc/ifstat.c +4
-2@@ -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;