X-Git-Url: http://git.annexia.org/?p=virt-top.git;a=blobdiff_plain;f=virt-top%2Fvirt_top_main.ml;h=bd9b57594ca88b41245274087a27178032e8c2a2;hp=4ab60ada291f0584f2a4552bda8998be8a23dba5;hb=671a014d3e61c300a26f7d5a5a3e344d7a7ac0ef;hpb=46d3772c9a5cf786fa4fbdb2ba29512580101f32 diff --git a/virt-top/virt_top_main.ml b/virt-top/virt_top_main.ml index 4ab60ad..bd9b575 100644 --- a/virt-top/virt_top_main.ml +++ b/virt-top/virt_top_main.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify @@ -31,20 +31,23 @@ open Virt_top * the program under --debug ...). *) let error = - let ((_, _, script_mode, _, _, _, _) as setup) = start_up () in + let ((_, _, script_mode, _, stream_mode, _, _, _) as setup) = start_up () in try + Printexc.record_backtrace true; main_loop setup; - if not script_mode then endwin (); + if not script_mode && not stream_mode then endwin (); false with | Libvirt.Virterror err -> - if not script_mode then endwin (); + if not script_mode && not stream_mode then endwin (); prerr_endline (Libvirt.Virterror.to_string err); + Printexc.print_backtrace stderr; true | exn -> - if not script_mode then endwin (); + if not script_mode && not stream_mode then endwin (); prerr_endline (s_ "Error" ^ ": " ^ Printexc.to_string exn); + Printexc.print_backtrace stderr; true let () =