From c8315c1ac2889035c13dad89f7ef8cf2d46ff9f2 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 23 Dec 2015 17:35:00 +0100 Subject: [PATCH] Add extfs s_last_mounted support. --- ext/filesystem.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/filesystem.cpp b/ext/filesystem.cpp index f8cf969b..7a800cdc 100644 --- a/ext/filesystem.cpp +++ b/ext/filesystem.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "ext-constants.h" @@ -72,6 +73,13 @@ Filesystem::Filesystem(Device* device, const char* mount_path) sb->s_mtime = mtime_realtime; sb->s_mnt_count++; sb->s_state = EXT2_ERROR_FS; + // TODO: Remove this temporarily compatibility when this driver is moved + // into the kernel and the the FUSE frontend is removed. +#ifdef __GLIBC__ + strncpy(sb->s_last_mounted, mount_path, sizeof(sb->s_last_mounted)); +#else + strlcpy(sb->s_last_mounted, mount_path, sizeof(sb->s_last_mounted)); +#endif FinishWrite(); Sync(); }