fixes for glibc time/gettimeofday issue; fix issue with history file containing one line too few if saving timestamps; fix for signal arriving while displaying readline completions

This commit is contained in:
Chet Ramey
2023-03-27 09:28:12 -04:00
parent f539a75606
commit 64b2b7c08d
25 changed files with 344 additions and 125 deletions
+9
View File
@@ -52,6 +52,15 @@ struct timeval
extern int gettimeofday (struct timeval * restrict, void * restrict);
#endif
/* consistently use gettimeofday for time information */
static inline time_t
getnow(void)
{
struct timeval now;
gettimeofday (&now, 0);
return now.tv_sec;
}
/* These exist on BSD systems, at least. */
#if !defined (timerclear)
# define timerclear(tvp) do { (tvp)->tv_sec = 0; (tvp)->tv_usec = 0; } while (0)