You've already forked pgbackrest
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:
@ -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();
|
||||
|
Reference in New Issue
Block a user