summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-09-08 22:29:00 +0200
committerBjörn Jacke <bj@sernet.de>2010-09-08 22:33:32 +0200
commitb4b453a287781eba7adaa3c38bd174642a5cb651 (patch)
tree2a3869052078dc0cf16560c958ca17589bfe9cf5 /source3/utils
parent1b5cdd76b76a98e464f352c1d44be3ea0b279c87 (diff)
downloadsamba-b4b453a287781eba7adaa3c38bd174642a5cb651.tar.gz
samba-b4b453a287781eba7adaa3c38bd174642a5cb651.tar.bz2
samba-b4b453a287781eba7adaa3c38bd174642a5cb651.zip
s3: use time_mono throughout in smbget
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbget.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 85bbd245a6..b2fd894d0d 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)