redmine

Added "No space left on device" detection

Showing 1 changed file with 10 additions and 9 deletions
@@ -2569,14 +2569,14 @@ static inline int rsync_outline(FILE *outf, char *outline, eventinfo_flags_t fla @@ -2569,14 +2569,14 @@ static inline int rsync_outline(FILE *outf, char *outline, eventinfo_flags_t fla
2569 2569
2570 if (flags & EVIF_RECURSIVELY) { 2570 if (flags & EVIF_RECURSIVELY) {
2571 debug(3, "Recursively \"%s\": Writing to rsynclist: \"%s/***\".", outline, outline); 2571 debug(3, "Recursively \"%s\": Writing to rsynclist: \"%s/***\".", outline, outline);
2572 - fprintf(outf, "%s/***\n", outline); 2572 + critical_on ( fprintf(outf, "%s/***\n", outline) <= 0 );
2573 } else 2573 } else
2574 if (flags & EVIF_CONTENTRECURSIVELY) { 2574 if (flags & EVIF_CONTENTRECURSIVELY) {
2575 debug(3, "Content-recursively \"%s\": Writing to rsynclist: \"%s/**\".", outline, outline); 2575 debug(3, "Content-recursively \"%s\": Writing to rsynclist: \"%s/**\".", outline, outline);
2576 - fprintf(outf, "%s/**\n", outline); 2576 + critical_on ( fprintf(outf, "%s/**\n", outline) <= 0 );
2577 } else { 2577 } else {
2578 debug(3, "Non-recursively \"%s\": Writing to rsynclist: \"%s\".", outline, outline); 2578 debug(3, "Non-recursively \"%s\": Writing to rsynclist: \"%s\".", outline, outline);
2579 - fprintf(outf, "%s\n", outline); 2579 + critical_on ( fprintf(outf, "%s\n", outline) <= 0 );
2580 } 2580 }
2581 2581
2582 return 0; 2582 return 0;
@@ -2690,7 +2690,7 @@ int sync_idle_dosync_collectedevents_commitpart(struct dosync_arg *dosync_arg_p) @@ -2690,7 +2690,7 @@ int sync_idle_dosync_collectedevents_commitpart(struct dosync_arg *dosync_arg_p)
2690 g_hash_table_foreach_remove(indexes_p->out_lines_aggr_ht, rsync_aggrout, dosync_arg_p); 2690 g_hash_table_foreach_remove(indexes_p->out_lines_aggr_ht, rsync_aggrout, dosync_arg_p);
2691 2691
2692 if (dosync_arg_p->outf != NULL) { 2692 if (dosync_arg_p->outf != NULL) {
2693 - fclose(dosync_arg_p->outf); 2693 + critical_on(fclose(dosync_arg_p->outf));
2694 dosync_arg_p->outf = NULL; 2694 dosync_arg_p->outf = NULL;
2695 } 2695 }
2696 2696
@@ -2851,10 +2851,11 @@ void sync_idle_dosync_collectedevents_listpush(gpointer fpath_gp, gpointer evinf @@ -2851,10 +2851,11 @@ void sync_idle_dosync_collectedevents_listpush(gpointer fpath_gp, gpointer evinf
2851 (ctx_p->flags[MODE] == MODE_RSYNCDIRECT) || 2851 (ctx_p->flags[MODE] == MODE_RSYNCDIRECT) ||
2852 (ctx_p->flags[MODE] == MODE_RSYNCSO) 2852 (ctx_p->flags[MODE] == MODE_RSYNCSO)
2853 )) { 2853 )) {
2854 - if (ctx_p->flags[SYNCLISTSIMPLIFY]) 2854 + if (ctx_p->flags[SYNCLISTSIMPLIFY]) {
2855 - fprintf(outf, "%s\n", fpath); 2855 + critical_on ( fprintf(outf, "%s\n", fpath) <= 0 );
2856 - else 2856 + } else {
2857 - fprintf(outf, "sync %s %i %s\n", ctx_p->label, evinfo->evmask, fpath); 2857 + critical_on ( fprintf(outf, "sync %s %i %s\n", ctx_p->label, evinfo->evmask, fpath) <= 0);
  2858 + }
2858 return; 2859 return;
2859 } 2860 }
2860 2861
@@ -2947,7 +2948,7 @@ int sync_idle_dosync_collectedevents(ctx_t *ctx_p, indexes_t *indexes_p) { @@ -2947,7 +2948,7 @@ int sync_idle_dosync_collectedevents(ctx_t *ctx_p, indexes_t *indexes_p) {
2947 #endif 2948 #endif
2948 g_hash_table_foreach_remove(indexes_p->exc_fpath_ht, sync_idle_dosync_collectedevents_rsync_exclistpush, &dosync_arg); 2949 g_hash_table_foreach_remove(indexes_p->exc_fpath_ht, sync_idle_dosync_collectedevents_rsync_exclistpush, &dosync_arg);
2949 g_hash_table_foreach_remove(indexes_p->out_lines_aggr_ht, rsync_aggrout, &dosync_arg); 2950 g_hash_table_foreach_remove(indexes_p->out_lines_aggr_ht, rsync_aggrout, &dosync_arg);
2950 - fclose(dosync_arg.outf); 2951 + critical_on(fclose(dosync_arg.outf));
2951 #ifdef VERYPARANOID 2952 #ifdef VERYPARANOID
2952 require_strlen_le(dosync_arg.outf_path, PATH_MAX); 2953 require_strlen_le(dosync_arg.outf_path, PATH_MAX);
2953 #endif 2954 #endif