From: mquinson Date: Wed, 11 Jul 2007 17:15:44 +0000 (+0000) Subject: of course, you shouldn't use the simulated time but the native one to see whether... X-Git-Tag: v3.3~1621 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/16957701f9f986241cbf3236900a0e2e5b7612de of course, you shouldn't use the simulated time but the native one to see whether the user waited 5 sec before pressing Ctrl-C again git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3739 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/gras.c b/src/gras/gras.c index 5aba78e461..40c0fceeba 100644 --- a/src/gras/gras.c +++ b/src/gras/gras.c @@ -11,6 +11,7 @@ #include "xbt/log.h" #include "xbt/virtu.h" /* set the XBT virtualization to use GRAS */ #include "xbt/module.h" /* xbt_init/exit */ +#include "xbt/xbt_os_time.h" /* xbt_os_time */ #include "Virtu/virtu_interface.h" /* Module mechanism FIXME: deplace&rename */ #include "gras_modinter.h" /* module init/exit */ @@ -32,10 +33,11 @@ static void gras_sigusr_handler(int sig) { static void gras_sigint_handler(int sig) { static double lastone = 0; - if (lastone == 0 || gras_os_time() - lastone > 5) { - lastone = gras_os_time(); + if (lastone == 0 || xbt_os_time() - lastone > 5) { xbt_backtrace_display(); - fprintf(stderr,"\nBacktrace displayed because Ctrl-C was pressed. Press again (within 5 sec) to abort the process.\n"); + fprintf(stderr, + "\nBacktrace displayed because Ctrl-C was pressed. Press again (within 5 sec) to abort the process.\n"); + lastone = xbt_os_time(); } else { exit(1); }