s/ret/failed/ and move the fclose() to do_log()
Introduce os_localtime_r() and os_get_local_time()
Replace localtime() with os_localtime_r() in eval.c and undo.c