1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-12-01 22:30:09 +02:00

Replace THROW_ON_SYS_ERROR() with THROW_SYS_ERROR().

The former macro was hiding missing branch coverage for critical error handling.
This commit is contained in:
David Steele
2018-03-24 14:11:29 -04:00
parent c7a6e9d2f2
commit 9001b9b957
10 changed files with 55 additions and 54 deletions

View File

@@ -339,9 +339,8 @@ cmdHelp()
{
String *help = helpRender();
THROW_ON_SYS_ERROR(
write(STDOUT_FILENO, strPtr(help), strSize(help)) != (int)strSize(help), FileWriteError,
"unable to write help to stdout");
if (write(STDOUT_FILENO, strPtr(help), strSize(help)) != (int)strSize(help)) // {uncovered - write does not fail}
THROW_SYS_ERROR(FileWriteError, "unable to write help to stdout"); // {uncovered+}
}
MEM_CONTEXT_TEMP_END();
}