From 7580ac576f4bc22e051b6940326efe1fcd797775 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 17 Oct 2018 12:23:19 +0200 Subject: [PATCH] Make VFS host build work again. --- AK/kstdio.h | 1 + VirtualFileSystem/UnixTypes.h | 3 ++- VirtualFileSystem/VirtualFileSystem.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AK/kstdio.h b/AK/kstdio.h index 6f7c887e66..11a3b03bd6 100644 --- a/AK/kstdio.h +++ b/AK/kstdio.h @@ -5,4 +5,5 @@ #else #include #define kprintf printf +#define ksprintf sprintf #endif diff --git a/VirtualFileSystem/UnixTypes.h b/VirtualFileSystem/UnixTypes.h index 92eb9bc5a4..7b817cb6be 100644 --- a/VirtualFileSystem/UnixTypes.h +++ b/VirtualFileSystem/UnixTypes.h @@ -18,13 +18,14 @@ typedef dword gid_t; #ifdef SERENITY_KERNEL // FIXME: Support 64-bit offsets! typedef signed_dword off_t; +typedef unsigned int time_t; #else typedef signed_qword off_t; +typedef ::time_t time_t; #endif typedef dword blksize_t; typedef dword blkcnt_t; -typedef unsigned int time_t; typedef dword size_t; typedef signed_dword ssize_t; diff --git a/VirtualFileSystem/VirtualFileSystem.cpp b/VirtualFileSystem/VirtualFileSystem.cpp index 630b9204b3..b53c5cdb44 100644 --- a/VirtualFileSystem/VirtualFileSystem.cpp +++ b/VirtualFileSystem/VirtualFileSystem.cpp @@ -267,7 +267,8 @@ void VirtualFileSystem::listDirectory(const String& path) } kprintf("\033[30;1m"); - auto tm = *klocaltime(&metadata.mtime); + time_t mtime = metadata.mtime; + auto tm = *klocaltime(&mtime); kprintf("%04u-%02u-%02u %02u:%02u:%02u ", tm.tm_year + 1900, tm.tm_mon + 1,