Skip to content

Commit

Permalink
fix: Update libsmb2 submodule branch
Browse files Browse the repository at this point in the history
fix: fileDescriptor crash, compile error on time
  • Loading branch information
amosavian committed Dec 1, 2023
1 parent 0f3cc42 commit 68b396d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 5 additions & 1 deletion AMSMB2/Context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ extension SMB2Context {
}

var fileDescriptor: Int32 {
(try? smb2_get_fd(unsafe.unwrap())) ?? -1
do {
return try smb2_get_fd(unsafe.unwrap())
} catch {
return -1
}
}

var error: String? {
Expand Down
16 changes: 8 additions & 8 deletions AMSMB2/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ final class SMB2FileHandle {
context, cbPtr -> UnsafeMutablePointer<smb2_pdu>? in
var bfi = smb2_file_basic_info(
creation_time: smb2_timeval(
tv_sec: UInt32(stat.smb2_btime),
tv_usec: UInt32(stat.smb2_btime_nsec) / 1000),
tv_sec: .init(stat.smb2_btime),
tv_usec: .init(stat.smb2_btime_nsec / 1000)),
last_access_time: smb2_timeval(
tv_sec: UInt32(stat.smb2_atime),
tv_usec: UInt32(stat.smb2_atime_nsec) / 1000),
tv_sec: .init(stat.smb2_atime),
tv_usec: .init(stat.smb2_atime_nsec / 1000)),
last_write_time: smb2_timeval(
tv_sec: UInt32(stat.smb2_mtime),
tv_usec: UInt32(stat.smb2_mtime_nsec) / 1000),
tv_sec: .init(stat.smb2_mtime),
tv_usec: .init(stat.smb2_mtime_nsec / 1000)),
change_time: smb2_timeval(
tv_sec: UInt32(stat.smb2_ctime),
tv_usec: UInt32(stat.smb2_ctime_nsec) / 1000),
tv_sec: .init(stat.smb2_ctime),
tv_usec: .init(stat.smb2_ctime_nsec / 1000)),
file_attributes: attributes.rawValue)

var req = smb2_set_info_request()
Expand Down

0 comments on commit 68b396d

Please sign in to comment.