style: clang-format 18 (CI lint) on Wave-A sources
CI / lint (push) Successful in 48s
CI / sanitizers (address) (push) Successful in 47s
CI / sanitizers (undefined) (push) Successful in 48s
CI / fuzz-build (push) Successful in 19s
CI / coverage (push) Successful in 44s
CI / valgrind (push) Failing after 37s
CI / build-and-test (push) Successful in 4m36s
CI / lint (push) Successful in 48s
CI / sanitizers (address) (push) Successful in 47s
CI / sanitizers (undefined) (push) Successful in 48s
CI / fuzz-build (push) Successful in 19s
CI / coverage (push) Successful in 44s
CI / valgrind (push) Failing after 37s
CI / build-and-test (push) Successful in 4m36s
Reflow usage.c, config.c, file.c, test_client_cli.c, test_file.c so the clang-format check passes. Whitespace-only; no behavior change.
This commit is contained in:
+2
-1
@@ -182,7 +182,8 @@ void print_usage(void) {
|
|||||||
printf(" --copy-unsafe-links Only transform unsafe symlinks into referent files\n");
|
printf(" --copy-unsafe-links Only transform unsafe symlinks into referent files\n");
|
||||||
printf(" -S, --sparse Handle sparse files efficiently\n");
|
printf(" -S, --sparse Handle sparse files efficiently\n");
|
||||||
printf(" --inplace Update files in-place (no temp+rename)\n");
|
printf(" --inplace Update files in-place (no temp+rename)\n");
|
||||||
printf(" --preallocate Allocate destination file space up front (fail-fast on full disk)\n");
|
printf(
|
||||||
|
" --preallocate Allocate destination file space up front (fail-fast on full disk)\n");
|
||||||
printf(" --append Resume a shorter destination by appending only its tail\n");
|
printf(" --append Resume a shorter destination by appending only its tail\n");
|
||||||
printf(" (prefix is not verified; requires --incremental)\n");
|
printf(" (prefix is not verified; requires --incremental)\n");
|
||||||
printf(" --append-verify Like --append, but verifies the retained prefix checksum\n");
|
printf(" --append-verify Like --append, but verifies the retained prefix checksum\n");
|
||||||
|
|||||||
+9
-11
@@ -179,13 +179,12 @@ static bool validate_received_config(const Config* config) {
|
|||||||
valid_wire_bool(config->existing) && valid_wire_bool(config->update) &&
|
valid_wire_bool(config->existing) && valid_wire_bool(config->update) &&
|
||||||
valid_wire_bool(config->inplace) && valid_wire_bool(config->append) &&
|
valid_wire_bool(config->inplace) && valid_wire_bool(config->append) &&
|
||||||
valid_wire_bool(config->use_fsync) && valid_wire_bool(config->append_verify) &&
|
valid_wire_bool(config->use_fsync) && valid_wire_bool(config->append_verify) &&
|
||||||
valid_wire_bool(config->delete_excluded) && valid_wire_bool(config->force_delete) &&
|
valid_wire_bool(config->delete_excluded) && valid_wire_bool(config->force_delete) &&
|
||||||
valid_wire_bool(config->delete_missing_args) && valid_wire_bool(config->delete_after) &&
|
valid_wire_bool(config->delete_missing_args) && valid_wire_bool(config->delete_after) &&
|
||||||
valid_wire_bool(config->preallocate) &&
|
valid_wire_bool(config->preallocate) && valid_wire_bool(config->delete_delay) &&
|
||||||
valid_wire_bool(config->delete_delay) && valid_wire_bool(config->delete_during) &&
|
valid_wire_bool(config->delete_during) && valid_wire_bool(config->relative) &&
|
||||||
valid_wire_bool(config->relative) && valid_wire_bool(config->prune_empty_dirs) &&
|
valid_wire_bool(config->prune_empty_dirs) && valid_wire_bool(config->delay_updates) &&
|
||||||
valid_wire_bool(config->delay_updates) && valid_wire_bool(config->mkpath) &&
|
valid_wire_bool(config->mkpath) && !(config->delay_updates && config->inplace) &&
|
||||||
!(config->delay_updates && config->inplace) &&
|
|
||||||
!(config->delay_updates && delay_updates_staging_name_conflict(config->backup_dir)) &&
|
!(config->delay_updates && delay_updates_staging_name_conflict(config->backup_dir)) &&
|
||||||
valid_wire_bool(config->partial) && valid_wire_bool(config->delete_before) &&
|
valid_wire_bool(config->partial) && valid_wire_bool(config->delete_before) &&
|
||||||
valid_wire_bool(config->checksum) && valid_wire_bool(config->eight_bit_output) &&
|
valid_wire_bool(config->checksum) && valid_wire_bool(config->eight_bit_output) &&
|
||||||
@@ -450,10 +449,9 @@ static bool send_selection_options(int fd, const Config* c) {
|
|||||||
send_int(fd, c->use_fsync) && send_int(fd, c->append_verify) &&
|
send_int(fd, c->use_fsync) && send_int(fd, c->append_verify) &&
|
||||||
send_int(fd, c->delete_excluded) && send_int(fd, c->force_delete) &&
|
send_int(fd, c->delete_excluded) && send_int(fd, c->force_delete) &&
|
||||||
send_int(fd, c->delete_missing_args) && send_int(fd, c->delete_after) &&
|
send_int(fd, c->delete_missing_args) && send_int(fd, c->delete_after) &&
|
||||||
send_int(fd, c->preallocate) &&
|
send_int(fd, c->preallocate) && send_n_data(fd, &c->max_delete, sizeof(c->max_delete)) &&
|
||||||
send_n_data(fd, &c->max_delete, sizeof(c->max_delete)) && send_int(fd, c->relative) &&
|
send_int(fd, c->relative) && send_int(fd, c->prune_empty_dirs) &&
|
||||||
send_int(fd, c->prune_empty_dirs) && send_int(fd, c->mkpath) &&
|
send_int(fd, c->mkpath) && send_int(fd, c->delete_during) && send_int(fd, c->delete_delay);
|
||||||
send_int(fd, c->delete_during) && send_int(fd, c->delete_delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool send_skip_compress_options(int fd, const Config* c) {
|
static bool send_skip_compress_options(int fd, const Config* c) {
|
||||||
|
|||||||
+4
-5
@@ -562,9 +562,8 @@ static bool file_to_disk_secure_impl(const char* path, const void* data,
|
|||||||
if (preallocate && data_size > 0) {
|
if (preallocate && data_size > 0) {
|
||||||
prealloc_rc = preallocate_fd(fd, data_size);
|
prealloc_rc = preallocate_fd(fd, data_size);
|
||||||
if (prealloc_rc != 0)
|
if (prealloc_rc != 0)
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "preallocate failed for '%s' (%s); transfer aborted", path,
|
||||||
"preallocate failed for '%s' (%s); transfer aborted",
|
strerror(prealloc_rc));
|
||||||
path, strerror(prealloc_rc));
|
|
||||||
}
|
}
|
||||||
if (prealloc_rc == 0) {
|
if (prealloc_rc == 0) {
|
||||||
/* posix_fallocate does not guarantee the fd's file offset is left
|
/* posix_fallocate does not guarantee the fd's file offset is left
|
||||||
@@ -662,8 +661,8 @@ static bool file_to_disk_secure_impl(const char* path, const void* data,
|
|||||||
if (preallocate && data_size > 0) {
|
if (preallocate && data_size > 0) {
|
||||||
prealloc_rc = preallocate_fd(fd, data_size);
|
prealloc_rc = preallocate_fd(fd, data_size);
|
||||||
if (prealloc_rc != 0)
|
if (prealloc_rc != 0)
|
||||||
log_message(LOG_LEVEL_ERROR, "preallocate failed for '%s' (%s); transfer aborted",
|
log_message(LOG_LEVEL_ERROR, "preallocate failed for '%s' (%s); transfer aborted", path,
|
||||||
path, strerror(prealloc_rc));
|
strerror(prealloc_rc));
|
||||||
}
|
}
|
||||||
if (prealloc_rc == 0) {
|
if (prealloc_rc == 0) {
|
||||||
lseek(fd, 0, SEEK_SET);
|
lseek(fd, 0, SEEK_SET);
|
||||||
|
|||||||
@@ -2237,6 +2237,8 @@ static void test_parse_args_rejects_malformed_identity() {
|
|||||||
int positional_args[2];
|
int positional_args[2];
|
||||||
int positional_count = 0;
|
int positional_count = 0;
|
||||||
EXPECT_EQ_INT(parse_args(cfg, 2, argv, positional_args, &positional_count), -1);
|
EXPECT_EQ_INT(parse_args(cfg, 2, argv, positional_args, &positional_count), -1);
|
||||||
|
config_delete(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
/* --preallocate parses as a boolean flag and validates cleanly. */
|
/* --preallocate parses as a boolean flag and validates cleanly. */
|
||||||
static void test_parse_args_preallocate() {
|
static void test_parse_args_preallocate() {
|
||||||
|
|||||||
+4
-4
@@ -391,8 +391,8 @@ static void test_file_write_to_disk_with_fsync() {
|
|||||||
static void test_file_write_to_disk_preallocate_atomic() {
|
static void test_file_write_to_disk_preallocate_atomic() {
|
||||||
const char* path = "test_file_write_prealloc_atomic.txt";
|
const char* path = "test_file_write_prealloc_atomic.txt";
|
||||||
const char* content = "prealloc atomic content";
|
const char* content = "prealloc atomic content";
|
||||||
EXPECT_TRUE(file_to_disk_secure(path, content, strlen(content), false, false, true, NULL, false,
|
EXPECT_TRUE(
|
||||||
NULL));
|
file_to_disk_secure(path, content, strlen(content), false, false, true, NULL, false, NULL));
|
||||||
struct stat st;
|
struct stat st;
|
||||||
EXPECT_EQ_INT(stat(path, &st), 0);
|
EXPECT_EQ_INT(stat(path, &st), 0);
|
||||||
EXPECT_EQ_INT((int)st.st_size, (int)strlen(content));
|
EXPECT_EQ_INT((int)st.st_size, (int)strlen(content));
|
||||||
@@ -409,8 +409,8 @@ static void test_file_write_to_disk_preallocate_atomic() {
|
|||||||
static void test_file_write_to_disk_preallocate_inplace() {
|
static void test_file_write_to_disk_preallocate_inplace() {
|
||||||
const char* path = "test_file_write_prealloc_inplace.txt";
|
const char* path = "test_file_write_prealloc_inplace.txt";
|
||||||
const char* content = "prealloc inplace content";
|
const char* content = "prealloc inplace content";
|
||||||
EXPECT_TRUE(file_to_disk_secure(path, content, strlen(content), true, false, true, NULL, false,
|
EXPECT_TRUE(
|
||||||
NULL));
|
file_to_disk_secure(path, content, strlen(content), true, false, true, NULL, false, NULL));
|
||||||
struct stat st;
|
struct stat st;
|
||||||
EXPECT_EQ_INT(stat(path, &st), 0);
|
EXPECT_EQ_INT(stat(path, &st), 0);
|
||||||
EXPECT_EQ_INT((int)st.st_size, (int)strlen(content));
|
EXPECT_EQ_INT((int)st.st_size, (int)strlen(content));
|
||||||
|
|||||||
Reference in New Issue
Block a user