summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c4
-rw-r--r--source3/client/clitar.c37
2 files changed, 23 insertions, 18 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 1ff63aa836..385eb5a7cf 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -355,7 +355,7 @@ static BOOL do_this_one(file_info *finfo)
return False;
}
- if (newer_than && finfo->mtime < newer_than) {
+ if (newer_than && finfo->mtime_ts.tv_sec < newer_than) {
DEBUG(3,("newer_than %s failed\n", finfo->name));
return(False);
}
@@ -375,7 +375,7 @@ static BOOL do_this_one(file_info *finfo)
static void display_finfo(file_info *finfo)
{
if (do_this_one(finfo)) {
- time_t t = finfo->mtime; /* the time is assumed to be passed as GMT */
+ time_t t = finfo->mtime_ts.tv_sec; /* the time is assumed to be passed as GMT */
d_printf(" %-30s%7.7s %8.0f %s",
finfo->name,
attrib_string(finfo->mode),
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index f0d0ac595c..87ca3245c1 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -49,9 +49,9 @@ struct file_info_struct {
uid_t uid;
gid_t gid;
/* These times are normally kept in GMT */
- time_t mtime;
- time_t atime;
- time_t ctime;
+ struct timespec mtime_ts;
+ struct timespec atime_ts;
+ struct timespec ctime_ts;
char *name; /* This is dynamically allocate */
file_info2 *next, *prev; /* Used in the stack ... */
@@ -312,8 +312,9 @@ of link other than a GNUtar Longlink - ignoring\n"));
* We only get the modification time of the file; set the creation time
* from the mod. time, and the access time to current time
*/
- finfo->mtime = finfo->ctime = strtol(hb->dbuf.mtime, NULL, 8);
- finfo->atime = time(NULL);
+ finfo->mtime_ts = finfo->ctime_ts =
+ convert_time_t_to_timespec((time_t)strtol(hb->dbuf.mtime, NULL, 8));
+ finfo->atime_ts = convert_time_t_to_timespec(time(NULL));
finfo->size = unoct(hb->dbuf.size, sizeof(hb->dbuf.size));
return True;
@@ -625,18 +626,18 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
finfo.mode = finfo1 -> mode;
finfo.uid = finfo1 -> uid;
finfo.gid = finfo1 -> gid;
- finfo.mtime = finfo1 -> mtime;
- finfo.atime = finfo1 -> atime;
- finfo.ctime = finfo1 -> ctime;
+ finfo.mtime_ts = finfo1 -> mtime_ts;
+ finfo.atime_ts = finfo1 -> atime_ts;
+ finfo.ctime_ts = finfo1 -> ctime_ts;
finfo.name = finfo1 -> name;
} else {
finfo.size = def_finfo.size;
finfo.mode = def_finfo.mode;
finfo.uid = def_finfo.uid;
finfo.gid = def_finfo.gid;
- finfo.mtime = def_finfo.mtime;
- finfo.atime = def_finfo.atime;
- finfo.ctime = def_finfo.ctime;
+ finfo.mtime_ts = def_finfo.mtime_ts;
+ finfo.atime_ts = def_finfo.atime_ts;
+ finfo.ctime_ts = def_finfo.ctime_ts;
finfo.name = def_finfo.name;
}
@@ -667,11 +668,14 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
safe_strcpy(finfo.name,rname, strlen(rname));
if (!finfo1) {
- if (!cli_getattrE(cli, fnum, &finfo.mode, &finfo.size, NULL, &finfo.atime, &finfo.mtime)) {
+ time_t atime, mtime;
+ if (!cli_getattrE(cli, fnum, &finfo.mode, &finfo.size, NULL, &atime, &mtime)) {
DEBUG(0, ("getattrE: %s\n", cli_errstr(cli)));
return;
}
- finfo.ctime = finfo.mtime;
+ finfo.atime_ts = convert_time_t_to_timespec(atime);
+ finfo.mtime_ts = convert_time_t_to_timespec(mtime);
+ finfo.ctime_ts = finfo.mtime_ts;
}
DEBUG(3,("file %s attrib 0x%X\n",finfo.name,finfo.mode));
@@ -707,7 +711,8 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
/* Only if the first read succeeds, write out the tar header. */
if (!wrote_tar_header) {
/* write a tar header, don't bother with mode - just set to 100644 */
- writetarheader(tarhandle, rname, finfo.size, finfo.mtime, "100644 \0", ftype);
+ writetarheader(tarhandle, rname, finfo.size,
+ finfo.mtime_ts.tv_sec, "100644 \0", ftype);
wrote_tar_header = True;
}
@@ -836,7 +841,7 @@ strlen(finfo->name)=%d\nname=%s,cur_dir=%s\n",
/* write a tar directory, don't bother with mode - just set it to
* 40755 */
- writetarheader(tarhandle, cur_dir, 0, finfo->mtime, "040755 \0", '5');
+ writetarheader(tarhandle, cur_dir, 0, finfo->mtime_ts.tv_sec, "040755 \0", '5');
if (tar_noisy) {
DEBUG(0,(" directory %s\n", cur_dir));
}
@@ -1034,7 +1039,7 @@ static int get_file(file_info2 finfo)
/* Now we update the creation date ... */
DEBUG(5, ("Updating creation date on %s\n", finfo.name));
- if (!cli_setatr(cli, finfo.name, finfo.mode, finfo.mtime)) {
+ if (!cli_setatr(cli, finfo.name, finfo.mode, finfo.mtime_ts.tv_sec)) {
if (tar_real_noisy) {
DEBUG(0, ("Could not set time on file: %s\n", finfo.name));
/*return(False); */ /* Ignore, as Win95 does not allow changes */