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
+11 -2
View File
@@ -452,10 +452,19 @@ print_sig(void)
struct tm *timetm;
time_t clock;
datbuf[0] = '\0';
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
gettimeofday (&tv, 0);
clock = tv.tv_sec;
#else
clock = time(NULL);
#endif
timetm = localtime(&clock);
strftime(datbuf, MED_STR_MAX, TIMEFORMAT, timetm);
datbuf[0] = '\0';
if (timetm)
strftime(datbuf, MED_STR_MAX, TIMEFORMAT, timetm);
else
strcpy (datbuf, "??");
printf(signature, manpage, datbuf);
}