net/passt: Check return value of g_remove() in net_passt_cleanup() (CID 1612369)
If g_remove() fails, use warn_report() to log an error. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
c40ef7243f
commit
f74e4f2e60
1 changed files with 4 additions and 1 deletions
|
|
@ -103,7 +103,10 @@ static void net_passt_cleanup(NetClientState *nc)
|
|||
#endif
|
||||
|
||||
kill(s->pid, SIGTERM);
|
||||
g_remove(s->pidfile);
|
||||
if (g_remove(s->pidfile) != 0) {
|
||||
warn_report("Failed to remove passt pidfile %s: %s",
|
||||
s->pidfile, strerror(errno));
|
||||
}
|
||||
g_free(s->pidfile);
|
||||
g_ptr_array_free(s->args, TRUE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue