From 739dd1e5bc081db9688959a7c5e9bb1d4527ea6f Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Tue, 19 Mar 2024 14:39:23 +0000 Subject: [PATCH] Fix Linux compile error --- Sources/Hummingbird/Files/FileMiddleware.swift | 4 ---- Sources/Hummingbird/Files/LocalFileSystem.swift | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Hummingbird/Files/FileMiddleware.swift b/Sources/Hummingbird/Files/FileMiddleware.swift index f3f2a9b40..dad026f6b 100644 --- a/Sources/Hummingbird/Files/FileMiddleware.swift +++ b/Sources/Hummingbird/Files/FileMiddleware.swift @@ -12,11 +12,7 @@ // //===----------------------------------------------------------------------===// -#if os(Linux) -@preconcurrency import Foundation -#else import Foundation -#endif import HTTPTypes import Logging import NIOCore diff --git a/Sources/Hummingbird/Files/LocalFileSystem.swift b/Sources/Hummingbird/Files/LocalFileSystem.swift index 52f01198f..82472db2c 100644 --- a/Sources/Hummingbird/Files/LocalFileSystem.swift +++ b/Sources/Hummingbird/Files/LocalFileSystem.swift @@ -66,7 +66,11 @@ public struct LocalFileSystem: FileProvider { do { let lstat = try await self.fileIO.fileIO.lstat(path: path) let isFolder = (lstat.st_mode & S_IFMT) == S_IFDIR + #if os(Linux) + let modificationDate = Double(lstat.st_mtim.tv_sec) + (Double(lstat.st_mtim.tv_nsec) / 1_000_000_000.0) + #else let modificationDate = Double(lstat.st_mtimespec.tv_sec) + (Double(lstat.st_mtimespec.tv_nsec) / 1_000_000_000.0) + #endif return .init( isFolder: isFolder, size: numericCast(lstat.st_size),