From 3ac970ac1ddf8baa85e1d7ee6238ef646faad7f1 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 21 Nov 2019 14:19:49 +0100 Subject: [PATCH] Streamline Timestamp::INVALID values This is a follow-up patch for issue #1784 that solves two inconsistencies. - The Vfs::Timestamp::INVALID matches File_system::Timestamp::INVALID - The Noux libc plugin tests for Timestamp::INVALID instead of a positive value. The patch fixes the mtime info as shown in directory listings in Sculpt's inspect window. --- repos/os/include/vfs/types.h | 4 ++-- repos/ports/src/lib/libc_noux/plugin.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/os/include/vfs/types.h b/repos/os/include/vfs/types.h index 917f795cb..a004162ed 100644 --- a/repos/os/include/vfs/types.h +++ b/repos/os/include/vfs/types.h @@ -51,8 +51,8 @@ namespace Vfs { struct Timestamp { - static constexpr long long INVALID = (1LL << 63) + 1; - long long value; + static constexpr Genode::int64_t INVALID = 0x7fffffffffffffffLL; + Genode::int64_t value; }; enum class Node_type { diff --git a/repos/ports/src/lib/libc_noux/plugin.cc b/repos/ports/src/lib/libc_noux/plugin.cc index 0a9cb6fa0..a2d6b7b60 100644 --- a/repos/ports/src/lib/libc_noux/plugin.cc +++ b/repos/ports/src/lib/libc_noux/plugin.cc @@ -419,7 +419,7 @@ static void _sysio_to_stat_struct(Noux::Sysio const *sysio, struct stat *buf) buf->st_ino = src.inode; buf->st_dev = src.device; - if (src.modification_time.value >= 0) + if (src.modification_time.value != Vfs::Timestamp::INVALID) buf->st_mtime = src.modification_time.value; }