You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-11-08 03:22:25 +03:00
Start work on C handle io object and use it to output help.
This commit is contained in:
@@ -4,6 +4,7 @@ Help Command
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/io/handle.h"
|
||||
#include "common/memContext.h"
|
||||
#include "common/type.h"
|
||||
#include "config/config.h"
|
||||
@@ -337,10 +338,7 @@ cmdHelp()
|
||||
{
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
String *help = helpRender();
|
||||
|
||||
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+}
|
||||
ioHandleWriteOneStr(STDOUT_FILENO, helpRender());
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user