* If sock is negative, it means we don't have to notify the other side
* (e.g. application has already vanished).
*/
* If sock is negative, it means we don't have to notify the other side
* (e.g. application has already vanished).
*/
- if (data->shm_fd >= 0)
- close(data->shm_fd);
- if (data->wait_fd >= 0)
- close(data->wait_fd);
+ if (data->shm_fd >= 0) {
+ ret = close(data->shm_fd);
+ if (ret < 0) {
+ return ret;
+ }
+ }
+ if (data->wait_fd >= 0) {
+ ret = close(data->wait_fd);
+ if (ret < 0) {
+ return ret;
+ }
+ }
if (sock >= 0) {
memset(&lum, 0, sizeof(lum));
lum.handle = data->handle;
lum.cmd = LTTNG_UST_RELEASE;
ret = ustcomm_send_app_cmd(sock, &lum, &lur);
if (sock >= 0) {
memset(&lum, 0, sizeof(lum));
lum.handle = data->handle;
lum.cmd = LTTNG_UST_RELEASE;
ret = ustcomm_send_app_cmd(sock, &lum, &lur);