"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/stat-time.h" between
bison-3.8.1.tar.xz and bison-3.8.2.tar.xz

About: Bison is a general-purpose parser generator.

stat-time.h  (bison-3.8.1.tar.xz):stat-time.h  (bison-3.8.2.tar.xz)
skipping to change at line 105 skipping to change at line 105
return STAT_TIMESPEC (st, st_mtim).tv_nsec; return STAT_TIMESPEC (st, st_mtim).tv_nsec;
# elif defined STAT_TIMESPEC_NS # elif defined STAT_TIMESPEC_NS
return STAT_TIMESPEC_NS (st, st_mtim); return STAT_TIMESPEC_NS (st, st_mtim);
# else # else
return 0; return 0;
# endif # endif
} }
/* Return the nanosecond component of *ST's birth time. */ /* Return the nanosecond component of *ST's birth time. */
_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE _GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
get_stat_birthtime_ns (struct stat const *st _GL_UNUSED) get_stat_birthtime_ns (_GL_UNUSED struct stat const *st)
{ {
# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
return STAT_TIMESPEC (st, st_birthtim).tv_nsec; return STAT_TIMESPEC (st, st_birthtim).tv_nsec;
# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC # elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
return STAT_TIMESPEC_NS (st, st_birthtim); return STAT_TIMESPEC_NS (st, st_birthtim);
# else # else
return 0; return 0;
# endif # endif
} }
skipping to change at line 161 skipping to change at line 161
struct timespec t; struct timespec t;
t.tv_sec = st->st_mtime; t.tv_sec = st->st_mtime;
t.tv_nsec = get_stat_mtime_ns (st); t.tv_nsec = get_stat_mtime_ns (st);
return t; return t;
#endif #endif
} }
/* Return *ST's birth time, if available; otherwise return a value /* Return *ST's birth time, if available; otherwise return a value
with tv_sec and tv_nsec both equal to -1. */ with tv_sec and tv_nsec both equal to -1. */
_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE _GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
get_stat_birthtime (struct stat const *st _GL_UNUSED) get_stat_birthtime (_GL_UNUSED struct stat const *st)
{ {
struct timespec t; struct timespec t;
#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ #if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
|| defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC) || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC)
t = STAT_TIMESPEC (st, st_birthtim); t = STAT_TIMESPEC (st, st_birthtim);
#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC #elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
t.tv_sec = st->st_birthtime; t.tv_sec = st->st_birthtime;
t.tv_nsec = st->st_birthtimensec; t.tv_nsec = st->st_birthtimensec;
#elif defined _WIN32 && ! defined __CYGWIN__ #elif defined _WIN32 && ! defined __CYGWIN__
skipping to change at line 211 skipping to change at line 211
return t; return t;
} }
/* If a stat-like function returned RESULT, normalize the timestamps /* If a stat-like function returned RESULT, normalize the timestamps
in *ST, in case this platform suffers from the Solaris 11 bug where in *ST, in case this platform suffers from the Solaris 11 bug where
tv_nsec might be negative. Return the adjusted RESULT, setting tv_nsec might be negative. Return the adjusted RESULT, setting
errno to EOVERFLOW if normalization overflowed. This function errno to EOVERFLOW if normalization overflowed. This function
is intended to be private to this .h file. */ is intended to be private to this .h file. */
_GL_STAT_TIME_INLINE int _GL_STAT_TIME_INLINE int
stat_time_normalize (int result, struct stat *st _GL_UNUSED) stat_time_normalize (int result, _GL_UNUSED struct stat *st)
{ {
#if defined __sun && defined STAT_TIMESPEC #if defined __sun && defined STAT_TIMESPEC
if (result == 0) if (result == 0)
{ {
long int timespec_hz = 1000000000; long int timespec_hz = 1000000000;
short int const ts_off[] = { offsetof (struct stat, st_atim), short int const ts_off[] = { offsetof (struct stat, st_atim),
offsetof (struct stat, st_mtim), offsetof (struct stat, st_mtim),
offsetof (struct stat, st_ctim) }; offsetof (struct stat, st_ctim) };
int i; int i;
for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++) for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)