1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Print warning, if can not close or remove temporary file

This commit is contained in:
Andrei Kortunov 2018-09-08 20:20:41 +04:00
parent d5bcc49079
commit a262e4b342

View File

@ -175,17 +175,18 @@ static void gdb_info(pid_t pid)
fflush(stdout); fflush(stdout);
/* Clean up */ /* Clean up */
remove(respfile); if (remove(respfile) != 0)
Log(Debug::Warning) << "Warning: can not remove file '" << respfile << "': " << std::strerror(errno);
} }
else else
{ {
/* Error creating temp file */ /* Error creating temp file */
if(fd >= 0) if(fd >= 0)
{ {
if (close(fd) == 0) if (close(fd) != 0)
remove(respfile); Log(Debug::Warning) << "Warning: can not close file '" << respfile << "': " << std::strerror(errno);
else else if (remove(respfile) != 0)
Log(Debug::Warning) << "Warning: can not close and remove file '" << respfile << "': " << std::strerror(errno); Log(Debug::Warning) << "Warning: can not remove file '" << respfile << "': " << std::strerror(errno);
} }
printf("!!! Could not create gdb command file\n"); printf("!!! Could not create gdb command file\n");
} }