1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-16 08:15:31 +00:00

Use settimeofday() instead of stime(). (#65)

Also, fully initialize timeval usec to 0. (Noticed by @nbriggs.)
This commit is contained in:
Bruce Mitchener 2020-12-16 00:45:51 +07:00 committed by GitHub
parent e6a5d898c5
commit 3de2787166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -335,15 +335,12 @@ void subr_settime(LispPTR args[])
dosday.year = uxtime.tm_year;
dosday.dayofweek = uxtime.tm_wday;
_dos_setdate(&dosday);
#elif defined(SYSVONLY) && !defined(MACOSX) && !defined(LINUX)
time_t newTime = (time_t)(*((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF);
stime(&newTime);
#else
struct timeval timev;
timev.tv_sec = *((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF;
timev.tv_usec = 0;
settimeofday(&timev, NULL);
#endif /* DOS */
#endif
} /* end subr_settime */
/************************************************************************/