mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
Fix compile errors on ubuntu 20.04 (#4931)
This commit is contained in:
parent
5df3bac110
commit
408c0cf1c9
@ -2635,7 +2635,11 @@ void print_report(mako_args_t* args,
|
||||
fseek(f, 0, 0);
|
||||
index = 0;
|
||||
while (index < numPoints) {
|
||||
fread(&dataPoints[op][k++], sizeof(uint64_t), 1, f);
|
||||
size_t nread = fread(&dataPoints[op][k++], sizeof(uint64_t), 1, f);
|
||||
if (nread != 1) {
|
||||
fprintf(stderr, "ERROR: read failed\n");
|
||||
exit(1);
|
||||
}
|
||||
++index;
|
||||
}
|
||||
fclose(f);
|
||||
@ -2759,7 +2763,11 @@ void print_report(mako_args_t* args,
|
||||
|
||||
char command_remove[NAME_MAX] = { '\0' };
|
||||
sprintf(command_remove, "rm -rf %s%d", TEMP_DATA_STORE, *pid_main);
|
||||
system(command_remove);
|
||||
int ret = system(command_remove);
|
||||
if (ret != 0) {
|
||||
fprintf(stderr, "ERROR: system() call failed\n");
|
||||
exit(ret);
|
||||
}
|
||||
|
||||
for (op = 0; op < MAX_OP; op++) {
|
||||
if (args->txnspec.ops[op][OP_COUNT] > 0 || op == OP_TRANSACTION) {
|
||||
|
@ -406,21 +406,21 @@ TransportData::TransportData(uint64_t transportId, int maxWellKnownEndpoints, IP
|
||||
struct ConnectPacket {
|
||||
// The value does not include the size of `connectPacketLength` itself,
|
||||
// but only the other fields of this structure.
|
||||
uint32_t connectPacketLength;
|
||||
uint32_t connectPacketLength = 0;
|
||||
ProtocolVersion protocolVersion; // Expect currentProtocolVersion
|
||||
|
||||
uint16_t canonicalRemotePort; // Port number to reconnect to the originating process
|
||||
uint64_t connectionId; // Multi-version clients will use the same Id for both connections, other connections will
|
||||
// set this to zero. Added at protocol Version 0x0FDB00A444020001.
|
||||
uint16_t canonicalRemotePort = 0; // Port number to reconnect to the originating process
|
||||
uint64_t connectionId = 0; // Multi-version clients will use the same Id for both connections, other connections
|
||||
// will set this to zero. Added at protocol Version 0x0FDB00A444020001.
|
||||
|
||||
// IP Address to reconnect to the originating process. Only one of these must be populated.
|
||||
uint32_t canonicalRemoteIp4;
|
||||
uint32_t canonicalRemoteIp4 = 0;
|
||||
|
||||
enum ConnectPacketFlags { FLAG_IPV6 = 1 };
|
||||
uint16_t flags;
|
||||
uint8_t canonicalRemoteIp6[16];
|
||||
uint16_t flags = 0;
|
||||
uint8_t canonicalRemoteIp6[16] = { 0 };
|
||||
|
||||
ConnectPacket() { memset(this, 0, sizeof(*this)); }
|
||||
ConnectPacket() = default;
|
||||
|
||||
IPAddress canonicalRemoteIp() const {
|
||||
if (isIPv6()) {
|
||||
|
@ -242,7 +242,9 @@ ACTOR Future<int> spawnProcess(std::string binPath,
|
||||
|
||||
static auto fork_child(const std::string& path, std::vector<char*>& paramList) {
|
||||
int pipefd[2];
|
||||
pipe(pipefd);
|
||||
if (pipe(pipefd) != 0) {
|
||||
return std::make_pair(-1, Optional<int>{});
|
||||
}
|
||||
auto readFD = pipefd[0];
|
||||
auto writeFD = pipefd[1];
|
||||
pid_t pid = fork();
|
||||
|
@ -663,7 +663,7 @@ static void printUsage(const char* name, bool devhelp) {
|
||||
" collector_endpoint -- IP:PORT of the fluentd server\n"
|
||||
" collector_protocol -- UDP or TCP (default is UDP)");
|
||||
#ifndef TLS_DISABLED
|
||||
printf(TLS_HELP);
|
||||
printf("%s", TLS_HELP);
|
||||
#endif
|
||||
printOptionUsage("-v, --version", "Print version information and exit.");
|
||||
printOptionUsage("-h, -?, --help", "Display this help and exit.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user