From: Björn Jacke Date: Wed, 8 Sep 2010 20:29:00 +0000 (+0200) Subject: s3: use time_mono throughout in smbget X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=b4b453a287781eba7adaa3c38bd174642a5cb651;p=rusty%2Fsamba.git s3: use time_mono throughout in smbget --- diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index 85bbd245a6d..b2fd894d0d2 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -276,7 +276,8 @@ static int smb_download_file(const char *base, const char *name, int recursive, int resume, int toplevel, char *outfile) { int remotehandle, localhandle; - struct timespec start_time, now; + time_t start_time = time_mono(NULL); + time_t now; const char *newpath; char path[SMB_MAXPATHLEN]; char checkbuf[2][RESUME_CHECK_SIZE]; @@ -284,7 +285,6 @@ static int smb_download_file(const char *base, const char *name, int recursive, off_t offset_download = 0, offset_check = 0, curpos = 0, start_offset = 0; struct stat localstat, remotestat; - clock_gettime_mono(&start_time); snprintf(path, SMB_MAXPATHLEN-1, "%s%s%s", base, (*base && *name && name[0] != '/' && base[strlen(base)-1] != '/')?"/":"", name); remotehandle = smbc_open(path, O_RDONLY, 0755); @@ -467,8 +467,7 @@ static int smb_download_file(const char *base, const char *name, int recursive, if(dots)fputc('.', stderr); else if(!quiet) { - clock_gettime_mono(&now); - print_progress(newpath, start_time.tv_sec, now.tv_sec, + print_progress(newpath, start_time, time_mono(NULL), start_offset, curpos, remotestat.st_size); } } @@ -509,7 +508,7 @@ static void clean_exit(void) char bs[100]; human_readable(total_bytes, bs, sizeof(bs)); if(!quiet)fprintf(stderr, "Downloaded %s in %lu seconds\n", bs, - (unsigned long)(time(NULL) - total_start_time)); + (unsigned long)(time_mono(NULL) - total_start_time)); exit(0); } @@ -668,7 +667,7 @@ int main(int argc, const char **argv) columns = get_num_cols(); - total_start_time = time(NULL); + total_start_time = time_mono(NULL); while ( (file = poptGetArg(pc)) ) { if (!recursive)