Signed-off-by: Sami Kerola <kerolasa@xxxxxx> --- fdisks/cfdisk.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fdisks/cfdisk.c b/fdisks/cfdisk.c index db9e233..dcaa05d 100644 --- a/fdisks/cfdisk.c +++ b/fdisks/cfdisk.c @@ -1849,7 +1849,11 @@ print_raw_table(void) { if (to_file) { if (!print_only) - fclose(fp); + if (close_stream(fp) != 0) { + char errstr[LINE_LENGTH]; + snprintf(errstr, sizeof(errstr), _("write failed: %s"), fname); + print_warning(errstr); + } } else { menuContinue(); } @@ -1966,7 +1970,11 @@ print_p_info(void) { if (to_file) { if (!print_only) - fclose(fp); + if (close_stream(fp) != 0) { + char errstr[LINE_LENGTH]; + snprintf(errstr, sizeof(errstr), _("write failed: %s"), fname); + print_warning(errstr); + } } else { menuContinue(); } @@ -2060,7 +2068,11 @@ print_part_table(void) { if (to_file) { if (!print_only) - fclose(fp); + if (close_stream(fp) != 0) { + char errstr[LINE_LENGTH]; + snprintf(errstr, sizeof(errstr), _("write failed: %s"), fname); + print_warning(errstr); + } } else { menuContinue(); } -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html