Based on a Coverity report - the return value of waitpid() should
always be checked, to avoid problems with leaking resources.
* src/lxc/lxc_controller.c (lxcControllerRun): Use simpler virPidAbort.
#include "util.h"
#include "virfile.h"
#include "virpidfile.h"
+#include "command.h"
#define VIR_FROM_THIS VIR_FROM_LXC
VIR_FORCE_CLOSE(loopDevs[i]);
VIR_FREE(loopDevs);
- if (container > 1) {
- int status;
- kill(container, SIGTERM);
- if (!(waitpid(container, &status, WNOHANG) == 0 &&
- WIFEXITED(status)))
- kill(container, SIGKILL);
- waitpid(container, NULL, 0);
- }
+ virPidAbort(container);
+
return rc;
}