diff options
author | Olivier Hainque <hainque@adacore.com> | 2020-10-09 12:33:24 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-25 08:22:30 -0500 |
commit | 4d617c3f2ad9a6a4f8718cd216421eeb65ede262 (patch) | |
tree | a73ca44f24927febba4944d9536be1802c06e32e | |
parent | a6fecb06710ff3bae9dbad6cf480a4934a84bb3c (diff) | |
download | gcc-4d617c3f2ad9a6a4f8718cd216421eeb65ede262.zip gcc-4d617c3f2ad9a6a4f8718cd216421eeb65ede262.tar.gz gcc-4d617c3f2ad9a6a4f8718cd216421eeb65ede262.tar.bz2 |
[Ada] Reinstate utime based code for vx6 in __gnat_copy_attribs
gcc/ada/
* adaint.c (__gnat_copy_attribs): Reinstate code based on utime
for timestamp processing on VxWorks 6.
-rw-r--r-- | gcc/ada/adaint.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 554123c..41453d1 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -3267,7 +3267,22 @@ __gnat_copy_attribs (char *from ATTRIBUTE_UNUSED, char *to ATTRIBUTE_UNUSED, return -1; } -#if _POSIX_C_SOURCE >= 200809L +#if (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 7) + + /* VxWorks prior to 7 only has utime. */ + + /* Do we need to copy the timestamp ? */ + if (mode != 2) { + struct utimbuf tbuf; + + tbuf.actime = fbuf.st_atime; + tbuf.modtime = fbuf.st_mtime; + + if (utime (to, &tbuf) == -1) + return -1; + } + +#elif _POSIX_C_SOURCE >= 200809L struct timespec tbuf[2]; if (mode != 2) { |