X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Ftime.c;h=3a4604929a2669ed7fb1c02ed143e7f4031c34ce;hp=d2a20669902b7d976d2b3d3571e6aaeee293d530;hb=4accf3197235300029d04d0ab637b66eaaf9f8df;hpb=8863ecde5dba262c0736da7505a9fa3655ed42f6 diff --git a/fish/time.c b/fish/time.c index d2a2066..3a46049 100644 --- a/fish/time.c +++ b/fish/time.c @@ -1,5 +1,5 @@ /* guestfish - the filesystem interactive shell - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,11 +22,12 @@ #include #include #include +#include #include "fish.h" int -do_time (const char *cmd, int argc, char *argv[]) +run_time (const char *cmd, size_t argc, char *argv[]) { struct timeval start_t, end_t; int64_t start_us, end_us, elapsed_us; @@ -38,7 +39,7 @@ do_time (const char *cmd, int argc, char *argv[]) gettimeofday (&start_t, NULL); - if (issue_command (argv[0], &argv[1], NULL) == -1) + if (issue_command (argv[0], &argv[1], NULL, 0) == -1) return -1; gettimeofday (&end_t, NULL); @@ -47,8 +48,8 @@ do_time (const char *cmd, int argc, char *argv[]) end_us = (int64_t) end_t.tv_sec * 1000000 + end_t.tv_usec; elapsed_us = end_us - start_us; printf ("elapsed time: %d.%02d seconds\n", - (int) (elapsed_us / 1000000), - (int) ((elapsed_us / 10000) % 100)); + (int) (elapsed_us / 1000000), + (int) ((elapsed_us / 10000) % 100)); return 0; }