From b99887c4283f7b21428d21f98ae9f6fcf573c756 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 19 Aug 2019 18:01:45 -0400 Subject: [PATCH] Revert previous change to sys/stat.h and fix cris libgloss - revert previous fix which altered sys/stat.h - fix libgloss/cris/gensyscalls to undef st_atime, st_mtime, and st_ctime macros which cannot be used with new_stat structure --- libgloss/cris/gensyscalls | 18 ++++++++++++------ newlib/libc/include/sys/stat.h | 9 --------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/libgloss/cris/gensyscalls b/libgloss/cris/gensyscalls index 3e2f9af8c..c36f28488 100644 --- a/libgloss/cris/gensyscalls +++ b/libgloss/cris/gensyscalls @@ -60,6 +60,9 @@ EOF cat > fstat.c < #include +#undef st_atime +#undef st_mtime +#undef st_ctime int _fstat (int fd, struct stat *buf) { @@ -81,9 +84,9 @@ _fstat (int fd, struct stat *buf) buf->st_size = ks.st_size; buf->st_blksize = ks.st_blksize; buf->st_blocks = ks.st_blocks; - buf->st_atime = ks.st_atime; - buf->st_mtime = ks.st_mtime; - buf->st_ctime = ks.st_ctime; + buf->st_atim.tv_sec = ks.st_atime; + buf->st_mtim.tv_sec = ks.st_mtime; + buf->st_ctim.tv_sec = ks.st_ctime; R (retval) EOF cat > getpid.c < stat.c < #include +#undef st_atime +#undef st_mtime +#undef st_ctime int _stat (const char *path, struct stat *buf) { @@ -237,9 +243,9 @@ _stat (const char *path, struct stat *buf) buf->st_size = ks.st_size; buf->st_blksize = ks.st_blksize; buf->st_blocks = ks.st_blocks; - buf->st_atime = ks.st_atime; - buf->st_mtime = ks.st_mtime; - buf->st_ctime = ks.st_ctime; + buf->st_atim.tv_sec = ks.st_atime; + buf->st_mtim.tv_sec = ks.st_mtime; + buf->st_ctim.tv_sec = ks.st_ctime; R (retval) EOF cat > times.c <