A typical usage is to start lxc-monitor in popen() and parse the ouput. Unfortunately, glibc defaults to block buffering for pipes and you may have to wait several lines before anything is written to stdout... this prevent the use of lxc-monitor to implement automatons. Let's go line buffered !
Signed-off-by: Greg Kurz <gk...@fr.ibm.com> --- src/lxc/lxc_monitor.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c index 1da0906..3802d2e 100644 --- a/src/lxc/lxc_monitor.c +++ b/src/lxc/lxc_monitor.c @@ -84,6 +84,8 @@ int main(int argc, char *argv[]) if (fd < 0) return -1; + setlinebuf(stdout); + for (;;) { if (lxc_monitor_read(fd, &msg) < 0) return -1; ------------------------------------------------------------------------------ Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel