X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ftime.c;h=246a58055e6ae67e06632a16e08eb7010cd03a38;hb=c81a16a4e2e703d0aaa595151602bcf03430f6ab;hp=aae9afe0b4b520c8ffed3dfb66a46ece86e2a920;hpb=a7b73d4a1e09f12b2002083618056f0c823c1dcf;p=libguestfs.git diff --git a/fish/time.c b/fish/time.c index aae9afe..246a580 100644 --- a/fish/time.c +++ b/fish/time.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 @@ -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; }