diff --git a/include/nuttx/coredump.h b/include/nuttx/coredump.h index a48941b6d6..273c0f7cbf 100644 --- a/include/nuttx/coredump.h +++ b/include/nuttx/coredump.h @@ -51,10 +51,10 @@ struct coredump_info_s { - uint32_t magic; - struct utsname name; - time_t time; - size_t size; + uint32_t magic; + struct utsname name; + struct timespec time; + size_t size; }; /**************************************************************************** diff --git a/sched/misc/coredump.c b/sched/misc/coredump.c index d954a27b77..13947390cb 100644 --- a/sched/misc/coredump.c +++ b/sched/misc/coredump.c @@ -720,7 +720,7 @@ static void coredump_dump_blkdev(pid_t pid) info->magic = COREDUMP_MAGIC; info->size = g_blockstream.common.nput; - info->time = time(NULL); + clock_gettime(CLOCK_REALTIME, &info->time); uname(&info->name); ret = g_blockstream.inode->u.i_bops->write(g_blockstream.inode, (FAR void *)info, g_blockstream.geo.geo_nsectors - nsectors, nsectors);