summaryrefslogtreecommitdiff
path: root/src/cp.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-09-16 07:50:33 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-09-16 07:50:33 +0000
commit158d982669d3d05079da2b9cc8d8fcd8adf35a4b (patch)
tree038bcb1def910a55323b86f5ee12bad2839161a5 /src/cp.c
parent3ecd35f56fbb7f9b3f43cd12f862336acf7dca56 (diff)
downloadcoreutils-158d982669d3d05079da2b9cc8d8fcd8adf35a4b.tar.xz
Include stat-time.h, and use its functions instead of the obsolete
TIMESPEC_NS macro.
Diffstat (limited to 'src/cp.c')
-rw-r--r--src/cp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cp.c b/src/cp.c
index 6605ebcf8..4e08612a0 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -33,6 +33,7 @@
#include "filenamecat.h"
#include "quote.h"
#include "quotearg.h"
+#include "stat-time.h"
#include "utimens.h"
#define ASSIGN_BASENAME_STRDUPA(Dest, File_name) \
@@ -304,10 +305,8 @@ re_protect (char const *const_dst_name, size_t src_offset,
{
struct timespec timespec[2];
- timespec[0].tv_sec = src_sb.st_atime;
- timespec[0].tv_nsec = TIMESPEC_NS (src_sb.st_atim);
- timespec[1].tv_sec = src_sb.st_mtime;
- timespec[1].tv_nsec = TIMESPEC_NS (src_sb.st_mtim);
+ timespec[0] = get_stat_atime (&src_sb);
+ timespec[1] = get_stat_mtime (&src_sb);
if (utimens (dst_name, timespec))
{