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.
This commit is contained in:
Norman Feske 2019-11-21 14:19:49 +01:00
parent 3aaed7188f
commit 3ac970ac1d
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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;
}