X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=resize%2Fprogress_c.c;h=52e653bed529f85b33b82a42643b21595b6a172e;hp=dddf78706473e04eb7aadfb4a373cebdb3190568;hb=acd06dbe326da7cd883f0a7df599d0d173c4bd04;hpb=2faef37957629e0436308e759211209e5e823ee0 diff --git a/resize/progress_c.c b/resize/progress_c.c index dddf787..52e653b 100644 --- a/resize/progress_c.c +++ b/resize/progress_c.c @@ -53,18 +53,22 @@ static struct custom_operations progress_bar_custom_operations = { }; value -virt_resize_progress_bar_init (value unitv) +virt_resize_progress_bar_init (value machine_readablev) { - CAMLparam1 (unitv); + CAMLparam1 (machine_readablev); CAMLlocal1 (barv); struct progress_bar *bar; + int machine_readable = Bool_val (machine_readablev); + unsigned flags = 0; /* XXX Have to do this to get nl_langinfo to work properly. However * we should really only call this from main. */ setlocale (LC_ALL, ""); - bar = progress_bar_init (0); + if (machine_readable) + flags |= PROGRESS_BAR_MACHINE_READABLE; + bar = progress_bar_init (flags); if (bar == NULL) caml_raise_out_of_memory ();