Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177631404
D2020.1794893779.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D2020.1794893779.diff
View Options
Index: head/sbin/restore/dirs.c
===================================================================
--- head/sbin/restore/dirs.c
+++ head/sbin/restore/dirs.c
@@ -80,8 +80,8 @@
*/
struct modeinfo {
ino_t ino;
- struct timeval ctimep[2];
- struct timeval mtimep[2];
+ struct timespec ctimep[2];
+ struct timespec mtimep[2];
mode_t mode;
uid_t uid;
gid_t gid;
@@ -656,8 +656,8 @@
else
(void) chown(cp, node.uid, node.gid);
(void) chmod(cp, node.mode);
- utimes(cp, node.ctimep);
- utimes(cp, node.mtimep);
+ utimensat(AT_FDCWD, cp, node.ctimep, 0);
+ utimensat(AT_FDCWD, cp, node.mtimep, 0);
(void) chflags(cp, node.flags);
}
ep->e_flags &= ~NEW;
@@ -746,13 +746,13 @@
return (itp);
node.ino = ctxp->ino;
node.mtimep[0].tv_sec = ctxp->atime_sec;
- node.mtimep[0].tv_usec = ctxp->atime_nsec / 1000;
+ node.mtimep[0].tv_nsec = ctxp->atime_nsec;
node.mtimep[1].tv_sec = ctxp->mtime_sec;
- node.mtimep[1].tv_usec = ctxp->mtime_nsec / 1000;
+ node.mtimep[1].tv_nsec = ctxp->mtime_nsec;
node.ctimep[0].tv_sec = ctxp->atime_sec;
- node.ctimep[0].tv_usec = ctxp->atime_nsec / 1000;
+ node.ctimep[0].tv_nsec = ctxp->atime_nsec;
node.ctimep[1].tv_sec = ctxp->birthtime_sec;
- node.ctimep[1].tv_usec = ctxp->birthtime_nsec / 1000;
+ node.ctimep[1].tv_nsec = ctxp->birthtime_nsec;
node.extsize = ctxp->extsize;
node.mode = ctxp->mode;
node.flags = ctxp->file_flags;
Index: head/sbin/restore/tape.c
===================================================================
--- head/sbin/restore/tape.c
+++ head/sbin/restore/tape.c
@@ -569,20 +569,20 @@
gid_t gid;
mode_t mode;
int extsize;
- struct timeval mtimep[2], ctimep[2];
+ struct timespec mtimep[2], ctimep[2];
struct entry *ep;
char *buf;
curfile.name = name;
curfile.action = USING;
mtimep[0].tv_sec = curfile.atime_sec;
- mtimep[0].tv_usec = curfile.atime_nsec / 1000;
+ mtimep[0].tv_nsec = curfile.atime_nsec;
mtimep[1].tv_sec = curfile.mtime_sec;
- mtimep[1].tv_usec = curfile.mtime_nsec / 1000;
+ mtimep[1].tv_nsec = curfile.mtime_nsec;
ctimep[0].tv_sec = curfile.atime_sec;
- ctimep[0].tv_usec = curfile.atime_nsec / 1000;
+ ctimep[0].tv_nsec = curfile.atime_nsec;
ctimep[1].tv_sec = curfile.birthtime_sec;
- ctimep[1].tv_usec = curfile.birthtime_nsec / 1000;
+ ctimep[1].tv_nsec = curfile.birthtime_nsec;
extsize = curfile.extsize;
uid = getuid();
if (uid == 0)
@@ -628,8 +628,10 @@
set_extattr_link(name, buf, extsize);
(void) lchown(name, uid, gid);
(void) lchmod(name, mode);
- (void) lutimes(name, ctimep);
- (void) lutimes(name, mtimep);
+ (void) utimensat(AT_FDCWD, name, ctimep,
+ AT_SYMLINK_NOFOLLOW);
+ (void) utimensat(AT_FDCWD, name, mtimep,
+ AT_SYMLINK_NOFOLLOW);
(void) lchflags(name, flags);
return (GOOD);
}
@@ -658,8 +660,8 @@
}
(void) chown(name, uid, gid);
(void) chmod(name, mode);
- (void) utimes(name, ctimep);
- (void) utimes(name, mtimep);
+ (void) utimensat(AT_FDCWD, name, ctimep, 0);
+ (void) utimensat(AT_FDCWD, name, mtimep, 0);
(void) chflags(name, flags);
return (GOOD);
@@ -688,8 +690,8 @@
}
(void) chown(name, uid, gid);
(void) chmod(name, mode);
- (void) utimes(name, ctimep);
- (void) utimes(name, mtimep);
+ (void) utimensat(AT_FDCWD, name, ctimep, 0);
+ (void) utimensat(AT_FDCWD, name, mtimep, 0);
(void) chflags(name, flags);
return (GOOD);
@@ -714,8 +716,8 @@
set_extattr_fd(ofile, name, buf, extsize);
(void) fchown(ofile, uid, gid);
(void) fchmod(ofile, mode);
- (void) futimes(ofile, ctimep);
- (void) futimes(ofile, mtimep);
+ (void) futimens(ofile, ctimep);
+ (void) futimens(ofile, mtimep);
(void) fchflags(ofile, flags);
(void) close(ofile);
return (GOOD);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 17, 5:36 AM (22 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41793883
Default Alt Text
D2020.1794893779.diff (3 KB)
Attached To
Mode
D2020: restore: Preserve timestamps to the nanosecond
Attached
Detach File
Event Timeline