X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=resize%2Fprogress_c.c;h=2f25bbcc23c7512c3622b37a812fbfc1ce01f9a3;hp=dddf78706473e04eb7aadfb4a373cebdb3190568;hb=HEAD;hpb=2faef37957629e0436308e759211209e5e823ee0 diff --git a/resize/progress_c.c b/resize/progress_c.c index dddf787..2f25bbc 100644 --- a/resize/progress_c.c +++ b/resize/progress_c.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -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 ();