Skip to content

Commit

Permalink
Fix Linux compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Mar 19, 2024
1 parent 0da62c5 commit 739dd1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Sources/Hummingbird/Files/FileMiddleware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
//
//===----------------------------------------------------------------------===//

#if os(Linux)
@preconcurrency import Foundation
#else
import Foundation
#endif
import HTTPTypes
import Logging
import NIOCore
Expand Down
4 changes: 4 additions & 0 deletions Sources/Hummingbird/Files/LocalFileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 739dd1e

Please sign in to comment.