summaryrefslogtreecommitdiffstats
path: root/heal/src/glfs-heal.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-11-17 13:11:16 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-11-17 07:34:02 -0800
commit398cc2ce8b09dbff90aadfd483cadee9c90ec527 (patch)
tree33b5c856ab375050fb79a135240a9c762df63be3 /heal/src/glfs-heal.c
parent592fd52d5889cf8a46727b3609cdff60e9ef5c00 (diff)
cli: Print to screen frequently
Problem: CLI appears to be hung because XML document is not flushed periodically Fix: Flush the buffer as soon as we print something BUG: 1395993 Change-Id: Ic5f61d4c7d29ee162a124a049e60ceb810d6da6d Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/15863 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'heal/src/glfs-heal.c')
-rw-r--r--heal/src/glfs-heal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index e885dd9fe63..2a85e755151 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -119,6 +119,7 @@ glfsh_xml_init ()
/* <bricks> */
xmlTextWriterStartElement (glfsh_writer,
(xmlChar *)"bricks");
+ xmlTextWriterFlush (glfsh_writer);
xml_out:
return ret;
}
@@ -217,7 +218,9 @@ glfsh_print_xml_heal_op_status (int ret, uint64_t num_entries, char *fmt_str)
"%"PRIu64"", num_entries);
}
out:
- return xmlTextWriterEndElement (glfsh_writer);
+ ret = xmlTextWriterEndElement (glfsh_writer);
+ xmlTextWriterFlush (glfsh_writer);
+ return ret;
}
void
@@ -228,6 +231,7 @@ glfsh_print_xml_file_status (char *path, uuid_t gfid, char *status)
"%s", uuid_utoa (gfid));
xmlTextWriterWriteFormatString (glfsh_writer, "%s", path);
xmlTextWriterEndElement (glfsh_writer);
+ xmlTextWriterFlush (glfsh_writer);
return;
}
@@ -268,6 +272,7 @@ print:
remote_host ? remote_host : "-",
remote_subvol ? remote_subvol : "-");
XML_RET_CHECK_AND_GOTO (x_ret, xml_out);
+ xmlTextWriterFlush (glfsh_writer);
xml_out:
return ret;
}