1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-29 13:20:35 +00:00

Check if a temporary file was successfully closed

This commit is contained in:
Andrei Kortunov 2018-08-01 20:36:29 +04:00
parent 12144de8ed
commit 369ea7e177

View File

@ -182,8 +182,10 @@ static void gdb_info(pid_t pid)
/* Error creating temp file */
if(fd >= 0)
{
close(fd);
remove(respfile);
if (close(fd) == 0)
remove(respfile);
else
std::cerr << "Warning: can not close and remove file '" << respfile << "': " << std::strerror(errno) << std::endl;
}
printf("!!! Could not create gdb command file\n");
}