From 70244133f4d32356a26acd699cdaa36c62d440a4 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 3 Oct 2013 22:44:33 +0200 Subject: [PATCH] Changes the meaning of the -G, --gui option to now remove only the interactive output. All the other log options are not enabled by default. --- HISTORY | 2 ++ check.c | 97 ++++++++++++++++++++++++------------------------------ dup.c | 25 ++++++-------- parity.c | 6 ++-- pool.c | 14 ++++---- scan.c | 82 ++++++++++++--------------------------------- scrub.c | 16 ++++----- selftest.c | 10 +++--- snapraid.c | 23 ++++++------- snapraid.h | 2 +- state.c | 56 ++++++++++++++----------------- status.c | 32 ++++++++---------- sync.c | 16 ++++----- 13 files changed, 153 insertions(+), 228 deletions(-) diff --git a/HISTORY b/HISTORY index 3237d94d..c35faf78 100644 --- a/HISTORY +++ b/HISTORY @@ -16,6 +16,8 @@ SnapRAID HISTORY performance in scanning. * Removed the detailed list of errors from the screen output. To get it you must explicitely uses the -l, --log option. + It's now too detailed for the screen, because it now contains a lot + of more info. * For files with changes only in some blocks, updates the parity only for blocks that really are changed. * Reduced memory usage avoiding to allocate unnecessary memory. diff --git a/check.c b/check.c index 41d95193..4da95d2b 100644 --- a/check.c +++ b/check.c @@ -1113,9 +1113,8 @@ static int state_check_process(struct snapraid_state* state, int check, int fix, goto bail; } - if (state->opt.gui) { - fprintf(stdlog, "status:unrecoverable:%s:%s\n", handle[j].disk->name, file->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:unrecoverable:%s:%s\n", handle[j].disk->name, file->sub); + if (state->opt.verbose) { printf("Unrecoverable '%s'\n", path); } @@ -1129,9 +1128,8 @@ static int state_check_process(struct snapraid_state* state, int check, int fix, goto close_and_continue; } - if (state->opt.gui) { - fprintf(stdlog, "status:recovered:%s:%s\n", handle[j].disk->name, file->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:recovered:%s:%s\n", handle[j].disk->name, file->sub); + if (state->opt.verbose) { printf("Recovered '%s'\n", path); } @@ -1172,28 +1170,24 @@ static int state_check_process(struct snapraid_state* state, int check, int fix, /* print just the final status */ if (file_flag_has(file, FILE_IS_DAMAGED)) { if (!check) { - if (state->opt.gui) { - fprintf(stdlog, "status:damaged:%s:%s\n", handle[j].disk->name, file->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:damaged:%s:%s\n", handle[j].disk->name, file->sub); + if (state->opt.verbose) { printf("Damaged '%s'\n", path); } } else { - if (state->opt.gui) { - fprintf(stdlog, "status:unrecoverable:%s:%s\n", handle[j].disk->name, file->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:unrecoverable:%s:%s\n", handle[j].disk->name, file->sub); + if (state->opt.verbose) { printf("Unrecoverable '%s'\n", path); } } } else if (file_flag_has(file, FILE_IS_FIXED)) { - if (state->opt.gui) { - fprintf(stdlog, "status:recoverable:%s:%s\n", handle[j].disk->name, file->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:recoverable:%s:%s\n", handle[j].disk->name, file->sub); + if (state->opt.verbose) { printf("Recoverable '%s'\n", path); } } else { - if (state->opt.gui) { - fprintf(stdlog, "status:correct:%s:%s\n", handle[j].disk->name, file->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:correct:%s:%s\n", handle[j].disk->name, file->sub); + if (state->opt.verbose) { printf("Correct '%s'\n", path); } } @@ -1322,9 +1316,8 @@ close_and_continue: fprintf(stdlog, "fixed:%s:%s: Fixed empty file\n", disk->name, file->sub); ++recovered_error; - if (state->opt.gui) { - fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, file->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, file->sub); + if (state->opt.verbose) { printf("Recovered '%s%s'\n", disk->dir, file->sub); } } @@ -1488,9 +1481,8 @@ close_and_continue: ++recovered_error; } - if (state->opt.gui) { - fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, link->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, link->sub); + if (state->opt.verbose) { printf("Recovered '%s%s'\n", disk->dir, link->sub); } } @@ -1557,9 +1549,8 @@ close_and_continue: fprintf(stdlog, "dir_fixed:%s:%s: Fixed dir error\n", disk->name, dir->sub); ++recovered_error; - if (state->opt.gui) { - fprintf(stdlog, "status:ok:%s:%s\n", disk->name, dir->sub); - } else if (state->opt.verbose) { + fprintf(stdlog, "status:ok:%s:%s\n", disk->name, dir->sub); + if (state->opt.verbose) { printf("Recovered '%s%s'\n", disk->dir, dir->sub); } } @@ -1650,34 +1641,32 @@ bail: printf("Everything OK\n"); } - if (state->opt.gui) { - fprintf(stdlog, "summary:error:%u\n", error); - if (fix) - fprintf(stdlog, "summary:error_recovered:%u\n", recovered_error); - if (check) - fprintf(stdlog, "summary:error_unrecoverable:%u\n", unrecoverable_error); - if (fix) { - if (error + recovered_error + unrecoverable_error == 0) - fprintf(stdlog, "summary:exit:ok\n"); - else if (unrecoverable_error == 0) - fprintf(stdlog, "summary:exit:recovered\n"); - else - fprintf(stdlog, "summary:exit:unrecoverable\n"); - } else if (check) { - if (error + unrecoverable_error == 0) - fprintf(stdlog, "summary:exit:ok\n"); - else if (unrecoverable_error == 0) - fprintf(stdlog, "summary:exit:recoverable\n"); - else - fprintf(stdlog, "summary:exit:unrecoverable\n"); - } else { /* audit only */ - if (error == 0) - fprintf(stdlog, "summary:exit:ok\n"); - else - fprintf(stdlog, "summary:exit:error\n"); - } - fflush(stdlog); + fprintf(stdlog, "summary:error:%u\n", error); + if (fix) + fprintf(stdlog, "summary:error_recovered:%u\n", recovered_error); + if (check) + fprintf(stdlog, "summary:error_unrecoverable:%u\n", unrecoverable_error); + if (fix) { + if (error + recovered_error + unrecoverable_error == 0) + fprintf(stdlog, "summary:exit:ok\n"); + else if (unrecoverable_error == 0) + fprintf(stdlog, "summary:exit:recovered\n"); + else + fprintf(stdlog, "summary:exit:unrecoverable\n"); + } else if (check) { + if (error + unrecoverable_error == 0) + fprintf(stdlog, "summary:exit:ok\n"); + else if (unrecoverable_error == 0) + fprintf(stdlog, "summary:exit:recoverable\n"); + else + fprintf(stdlog, "summary:exit:unrecoverable\n"); + } else { /* audit only */ + if (error == 0) + fprintf(stdlog, "summary:exit:ok\n"); + else + fprintf(stdlog, "summary:exit:error\n"); } + fflush(stdlog); free(failed); free(failed_map); diff --git a/dup.c b/dup.c index 237ed9f0..0c92eec6 100644 --- a/dup.c +++ b/dup.c @@ -123,12 +123,9 @@ void state_dup(struct snapraid_state* state) if (dup) { ++count; size += dup->file->size; - if (state->opt.gui) { - fprintf(stdlog, "dup:%s:%s:%s:%s:%"PRIu64": dup\n", disk->name, file->sub, dup->disk->name, dup->file->sub, dup->file->size); - } else { - printf("%"PRIu64" '%s%s'\n", file->size / (1024*1024), disk->dir, file->sub); - printf("dup '%s%s'\n", dup->disk->dir, dup->file->sub); - } + fprintf(stdlog, "dup:%s:%s:%s:%s:%"PRIu64": dup\n", disk->name, file->sub, dup->disk->name, dup->file->sub, dup->file->size); + printf("%"PRIu64" '%s%s'\n", file->size / (1024*1024), disk->dir, file->sub); + printf("dup '%s%s'\n", dup->disk->dir, dup->file->sub); hash_free(hash); } else { tommy_hashdyn_insert(&hashset, &hash->nodeset, hash, hash32); @@ -145,15 +142,13 @@ void state_dup(struct snapraid_state* state) else printf("No duplicate\n"); - if (state->opt.gui) { - fprintf(stdlog, "summary:dup_count:%u\n", count); - fprintf(stdlog, "summary:dup_size:%"PRIu64"\n", size); - if (count == 0) { - fprintf(stdlog, "summary:exit:unique\n"); - } else { - fprintf(stdlog, "summary:exit:dup\n"); - } - fflush(stdlog); + fprintf(stdlog, "summary:dup_count:%u\n", count); + fprintf(stdlog, "summary:dup_size:%"PRIu64"\n", size); + if (count == 0) { + fprintf(stdlog, "summary:exit:unique\n"); + } else { + fprintf(stdlog, "summary:exit:dup\n"); } + fflush(stdlog); } diff --git a/parity.c b/parity.c index 744efba2..4e40f3ce 100644 --- a/parity.c +++ b/parity.c @@ -75,10 +75,8 @@ void parity_overflow(struct snapraid_state* state, data_off_t size) if (file->blockmax > 0) { if (file->blockvec[0].parity_pos >= blockalloc) { - if (state->opt.gui) { - fprintf(stdlog, "outofparity:%s:%s\n", disk->name, file->sub); - fflush(stdlog); - } + fprintf(stdlog, "outofparity:%s:%s\n", disk->name, file->sub); + fflush(stdlog); if (first) { first = 0; printf("Files outside the parity:\n"); diff --git a/pool.c b/pool.c index 75281f08..ff54b92d 100644 --- a/pool.c +++ b/pool.c @@ -204,11 +204,13 @@ void state_pool(struct snapraid_state* state) /* we ignore empty dirs in disk->dir */ } - if (!state->opt.gui) { - if (count) - printf("%u links created\n", count); - else - printf("No link created\n"); - } + if (count) + printf("%u links created\n", count); + else + printf("No link created\n"); + + fprintf(stdlog, "summary:link::%u\n", count); + fprintf(stdlog, "summary:exit:ok\n"); + fflush(stdlog); } diff --git a/scan.c b/scan.c index 391e7ad4..8fbc6ae6 100644 --- a/scan.c +++ b/scan.c @@ -95,7 +95,6 @@ static void scan_link(struct snapraid_scan* scan, struct snapraid_state* state, if (state->opt.gui) { fprintf(stdlog, "scan:equal:%s:%s\n", disk->name, link->sub); - fflush(stdlog); } } else { /* it's an update */ @@ -105,10 +104,7 @@ static void scan_link(struct snapraid_scan* scan, struct snapraid_state* state, ++scan->count_change; - if (state->opt.gui) { - fprintf(stdlog, "scan:update:%s:%s\n", disk->name, link->sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:update:%s:%s\n", disk->name, link->sub); if (output) { printf("Update '%s%s'\n", disk->dir, link->sub); } @@ -125,10 +121,7 @@ static void scan_link(struct snapraid_scan* scan, struct snapraid_state* state, /* create the new link */ ++scan->count_insert; - if (state->opt.gui) { - fprintf(stdlog, "scan:add:%s:%s\n", disk->name, sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:add:%s:%s\n", disk->name, sub); if (output) { printf("Add '%s%s'\n", disk->dir, sub); } @@ -365,10 +358,7 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state, /* if the path is different, it means a moved file with the same inode */ ++scan->count_move; - if (state->opt.gui) { - fprintf(stdlog, "scan:move:%s:%s:%s\n", disk->name, file->sub, sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:move:%s:%s:%s\n", disk->name, file->sub, sub); if (output) { printf("Move '%s%s' '%s%s'\n", disk->dir, file->sub, disk->dir, sub); } @@ -390,7 +380,6 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state, if (state->opt.gui) { fprintf(stdlog, "scan:equal:%s:%s\n", disk->name, file->sub); - fflush(stdlog); } } @@ -490,10 +479,7 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state, /* like when restoring a backup that restores also the timestamp */ ++scan->count_restore; - if (state->opt.gui) { - fprintf(stdlog, "scan:restore:%s:%s\n", disk->name, sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:restore:%s:%s\n", disk->name, sub); if (output) { printf("Restore '%s%s'\n", disk->dir, sub); } @@ -517,7 +503,6 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state, if (state->opt.gui) { fprintf(stdlog, "scan:equal:%s:%s\n", disk->name, file->sub); - fflush(stdlog); } } @@ -542,10 +527,7 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state, /* it has the same name, so it's an update */ ++scan->count_change; - if (state->opt.gui) { - fprintf(stdlog, "scan:update:%s:%s\n", disk->name, file->sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:update:%s:%s\n", disk->name, file->sub); if (output) { if (file->size != st->st_size) printf("Update '%s%s' new size\n", disk->dir, file->sub); @@ -561,10 +543,7 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state, /* if the name doesn't exist, it's a new file */ ++scan->count_insert; - if (state->opt.gui) { - fprintf(stdlog, "scan:add:%s:%s\n", disk->name, sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:add:%s:%s\n", disk->name, sub); if (output) { printf("Add '%s%s'\n", disk->dir, sub); } @@ -639,7 +618,6 @@ static void scan_emptydir(struct snapraid_scan* scan, struct snapraid_state* sta if (state->opt.gui) { fprintf(stdlog, "scan:equal:%s:%s\n", disk->name, dir->sub); - fflush(stdlog); } /* nothing more to do */ @@ -648,10 +626,7 @@ static void scan_emptydir(struct snapraid_scan* scan, struct snapraid_state* sta /* create the new dir */ ++scan->count_insert; - if (state->opt.gui) { - fprintf(stdlog, "scan:add:%s:%s\n", disk->name, sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:add:%s:%s\n", disk->name, sub); if (output) { printf("Add '%s%s'\n", disk->dir, sub); } @@ -1060,10 +1035,7 @@ void state_scan(struct snapraid_state* state, int output) if (!file_flag_has(file, FILE_IS_PRESENT)) { ++scan->count_remove; - if (state->opt.gui) { - fprintf(stdlog, "scan:remove:%s:%s\n", disk->name, file->sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:remove:%s:%s\n", disk->name, file->sub); if (output) { printf("Remove '%s%s'\n", disk->dir, file->sub); } @@ -1084,10 +1056,7 @@ void state_scan(struct snapraid_state* state, int output) if (!link_flag_has(link, FILE_IS_PRESENT)) { ++scan->count_remove; - if (state->opt.gui) { - fprintf(stdlog, "scan:remove:%s:%s\n", disk->name, link->sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:remove:%s:%s\n", disk->name, link->sub); if (output) { printf("Remove '%s%s'\n", disk->dir, link->sub); } @@ -1108,10 +1077,7 @@ void state_scan(struct snapraid_state* state, int output) if (!dir_flag_has(dir, FILE_IS_PRESENT)) { ++scan->count_remove; - if (state->opt.gui) { - fprintf(stdlog, "scan:remove:%s:%s\n", disk->name, dir->sub); - fflush(stdlog); - } + fprintf(stdlog, "scan:remove:%s:%s\n", disk->name, dir->sub); if (output) { printf("Remove '%s%s'\n", disk->dir, dir->sub); } @@ -1290,15 +1256,12 @@ void state_scan(struct snapraid_state* state, int output) printf("\tadded %d\n", total.count_insert); } - if (state->opt.gui) { - fprintf(stdlog, "summary:equal:%u\n", total.count_equal); - fprintf(stdlog, "summary:moved:%u\n", total.count_move); - fprintf(stdlog, "summary:restored:%u\n", total.count_restore); - fprintf(stdlog, "summary:changed:%u\n", total.count_change); - fprintf(stdlog, "summary:removed:%u\n", total.count_remove); - fprintf(stdlog, "summary:added:%u\n", total.count_insert); - fflush(stdlog); - } + fprintf(stdlog, "summary:equal:%u\n", total.count_equal); + fprintf(stdlog, "summary:moved:%u\n", total.count_move); + fprintf(stdlog, "summary:restored:%u\n", total.count_restore); + fprintf(stdlog, "summary:changed:%u\n", total.count_change); + fprintf(stdlog, "summary:removed:%u\n", total.count_remove); + fprintf(stdlog, "summary:added:%u\n", total.count_insert); no_difference = !total.count_move && !total.count_restore && !total.count_change && !total.count_remove && !total.count_insert; @@ -1310,15 +1273,12 @@ void state_scan(struct snapraid_state* state, int output) } } - if (state->opt.gui) { - if (no_difference) { - fprintf(stdlog, "summary:exit:equal\n"); - fflush(stdlog); - } else { - fprintf(stdlog, "summary:exit:diff\n"); - fflush(stdlog); - } + if (no_difference) { + fprintf(stdlog, "summary:exit:equal\n"); + } else { + fprintf(stdlog, "summary:exit:diff\n"); } + fflush(stdlog); } tommy_list_foreach(&scanlist, (tommy_foreach_func*)free); diff --git a/scrub.c b/scrub.c index d368a4b9..5031602c 100644 --- a/scrub.c +++ b/scrub.c @@ -393,15 +393,13 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par printf("Everything OK\n"); } - if (state->opt.gui) { - fprintf(stdlog, "summary:error_read:%u\n", error); - fprintf(stdlog, "summary:error_data:%u\n", silent_error); - if (error + silent_error == 0) - fprintf(stdlog, "summary:exit:ok\n"); - else - fprintf(stdlog, "summary:exit:error\n"); - fflush(stdlog); - } + fprintf(stdlog, "summary:error_read:%u\n", error); + fprintf(stdlog, "summary:error_data:%u\n", silent_error); + if (error + silent_error == 0) + fprintf(stdlog, "summary:exit:ok\n"); + else + fprintf(stdlog, "summary:exit:error\n"); + fflush(stdlog); bail: for(j=0;jopt = *opt; @@ -280,11 +281,9 @@ void state_config(struct snapraid_state* state, const char* path, const char* co state->command = command; - if (state->opt.gui) { - fprintf(stdlog, "version:%s\n", PACKAGE_VERSION); - fprintf(stdlog, "conf:%s\n", path); - fflush(stdlog); - } + fprintf(stdlog, "version:%s\n", PACKAGE_VERSION); + fprintf(stdlog, "conf:%s\n", path); + fflush(stdlog); f = sopen_read(path); if (!f) { @@ -643,30 +642,25 @@ void state_config(struct snapraid_state* state, const char* path, const char* co /* intentionally not set the prevhashseed, if used valgrind will warn about it */ - if (state->opt.gui) { - tommy_node* i; - unsigned l; - - fprintf(stdlog, "blocksize:%u\n", state->block_size); - for(i=state->disklist;i!=0;i=i->next) { - struct snapraid_disk* disk = i->data; - fprintf(stdlog, "disk:%s:%s\n", disk->name, disk->dir); - } - - switch (state->level) { - case 1 : fprintf(stdlog, "mode:raid5\n"); break; - case 2 : fprintf(stdlog, "mode:raid6\n"); break; - case 3 : fprintf(stdlog, "mode:raidTP\n"); break; - case 4 : fprintf(stdlog, "mode:raidQP\n"); break; - } - - for(l=0;llevel;++l) { - fprintf(stdlog, "%s:%s\n", lev_config_name(l), state->parity_path[l]); - } - if (state->pool[0] != 0) - fprintf(stdlog, "pool:%s\n", state->pool); - fflush(stdlog); + fprintf(stdlog, "blocksize:%u\n", state->block_size); + for(i=state->disklist;i!=0;i=i->next) { + struct snapraid_disk* disk = i->data; + fprintf(stdlog, "disk:%s:%s\n", disk->name, disk->dir); } + + switch (state->level) { + case 1 : fprintf(stdlog, "mode:raid5\n"); break; + case 2 : fprintf(stdlog, "mode:raid6\n"); break; + case 3 : fprintf(stdlog, "mode:raidTP\n"); break; + case 4 : fprintf(stdlog, "mode:raidQP\n"); break; + } + + for(l=0;llevel;++l) { + fprintf(stdlog, "%s:%s\n", lev_config_name(l), state->parity_path[l]); + } + if (state->pool[0] != 0) + fprintf(stdlog, "pool:%s\n", state->pool); + fflush(stdlog); } /** @@ -3119,10 +3113,8 @@ void state_read(struct snapraid_state* state) struct snapraid_content* content = node->data; pathcpy(path, sizeof(path), content->content); - if (state->opt.gui) { - fprintf(stdlog, "content:%s\n", path); - fflush(stdlog); - } + fprintf(stdlog, "content:%s\n", path); + fflush(stdlog); printf("Loading state from %s...\n", path); f = sopen_read(path); diff --git a/status.c b/status.c index 8e65000f..0281f874 100644 --- a/status.c +++ b/status.c @@ -178,13 +178,11 @@ int state_status(struct snapraid_state* state) } } - if (state->opt.gui) { - fprintf(stdlog, "summary:has_unsynched:%u\n", unsynched_blocks); - fprintf(stdlog, "summary:has_rehash:%u\n", rehash); - fprintf(stdlog, "summary:has_bad:%u\n", bad); - fprintf(stdlog, "time_count:%u\n", count); - fflush(stdlog); - } + fprintf(stdlog, "summary:has_unsynched:%u\n", unsynched_blocks); + fprintf(stdlog, "summary:has_rehash:%u\n", rehash); + fprintf(stdlog, "summary:has_bad:%u\n", bad); + fprintf(stdlog, "time_count:%u\n", count); + fflush(stdlog); if (!count) { fprintf(stderr, "The array is empty.\n"); @@ -195,18 +193,16 @@ int state_status(struct snapraid_state* state) /* sort the info to get the time info */ qsort(infomap, count, sizeof(snapraid_info), info_time_compare); - if (state->opt.gui) { - /* info for making the graph */ - i = 0; - while (i < count) { - unsigned j = i + 1; - while (j < count && info_get_time(infomap[i]) == info_get_time(infomap[j])) - ++j; - fprintf(stdlog, "time:%"PRIu64":%u\n", (uint64_t)info_get_time(infomap[i]), j - i); - i = j; - } - fflush(stdlog); + /* info for making the graph */ + i = 0; + while (i < count) { + unsigned j = i + 1; + while (j < count && info_get_time(infomap[i]) == info_get_time(infomap[j])) + ++j; + fprintf(stdlog, "time:%"PRIu64":%u\n", (uint64_t)info_get_time(infomap[i]), j - i); + i = j; } + fflush(stdlog); oldest = info_get_time(infomap[0]); median = info_get_time(infomap[count / 2]); diff --git a/sync.c b/sync.c index cae791b9..2ad5ce3d 100644 --- a/sync.c +++ b/sync.c @@ -453,15 +453,13 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari printf("Everything OK\n"); } - if (state->opt.gui) { - fprintf(stdlog, "summary:error_readwrite:%u\n", error); - fprintf(stdlog, "summary:error_data:%u\n", silent_error); - if (error + silent_error == 0) - fprintf(stdlog, "summary:exit:ok\n"); - else - fprintf(stdlog, "summary:exit:error\n"); - fflush(stdlog); - } + fprintf(stdlog, "summary:error_readwrite:%u\n", error); + fprintf(stdlog, "summary:error_data:%u\n", silent_error); + if (error + silent_error == 0) + fprintf(stdlog, "summary:exit:ok\n"); + else + fprintf(stdlog, "summary:exit:error\n"); + fflush(stdlog); bail: for(j=0;j