--- nono/vm/windrv.cpp 2026/04/29 17:05:37 1.1.1.3 +++ nono/vm/windrv.cpp 2026/04/29 17:06:00 1.1.1.5 @@ -24,8 +24,9 @@ #include "hostwindrv.h" #include "mainbus.h" #include "mpu680x0.h" +#include "mytime.h" #include -#include +#include #include // コンストラクタ @@ -61,8 +62,11 @@ WindrvDevice::Create() if (IsWindrv()) { // 対応するホストドライバを作成。 // 今はまだ1つのみ。 - hosts[0].reset(new HostWindrv(this)); + try { + hosts[0].reset(new HostWindrv(this)); + } catch (...) { } if ((bool)hosts[0] == false) { + warnx("Failed to initialize HostWindrv at %s", __method__); return false; } } @@ -1754,10 +1758,7 @@ FilesBuf::Init(uint32 key_, HostWindrv * void FilesBuf::UpdateATime() { - struct timeval tv; - - gettimeofday(&tv, NULL); - atime = (uint64)tv.tv_sec * 1000'000 + (uint64)tv.tv_usec; + atime = get_hosttime_usec(); } @@ -2298,10 +2299,7 @@ VDir::MatchName(const std::string& name, void VDir::UpdateATime() { - struct timeval tv; - - gettimeofday(&tv, NULL); - atime = (uint64)tv.tv_sec * 1000'000 + (uint64)tv.tv_usec; + atime = get_hosttime_usec(); }