1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-07 00:35:37 +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

@ -280,7 +280,9 @@ testRun()
// Redirect stdout to a file
int stdoutSave = dup(STDOUT_FILENO);
String *stdoutFile = strNewFmt("%s/stdout.help", testPath());
THROW_ON_SYS_ERROR(freopen(strPtr(stdoutFile), "w", stdout) == NULL, FileWriteError, "unable to reopen stdout");
if (freopen(strPtr(stdoutFile), "w", stdout) == NULL) // {uncoverable - does not fail}
THROW_SYS_ERROR(FileWriteError, "unable to reopen stdout"); // {uncoverable+}
// Not in a test wrapper to avoid writing to stdout
cmdHelp();