Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
icristescu committed Nov 8, 2022
1 parent 280c826 commit e208303
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/irmin-pack/unix/io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,13 @@ module Unix = struct
let dirfd =
Unix.openfile path Unix.[ O_RDONLY; O_SYNC; O_RSYNC ] default_open_perm
in
Unix.fsync dirfd;
let fsync_result =
try
Unix.fsync dirfd;
Ok ()
with Unix.Unix_error (e, s1, s2) -> Error (`Io_misc (e, s1, s2))
in
Unix.close dirfd;
Ok ()
fsync_result
with Unix.Unix_error (e, s1, s2) -> Error (`Io_misc (e, s1, s2))
end
2 changes: 1 addition & 1 deletion src/irmin-pack/unix/s.ml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module type S = sig
the existing one, containing only one commit, specified by the [key]. Note
that this operation is blocking.
If [repo] is opened with the flag [use_fsync] set, then [path] is flushed
If [repo] is opened with the flag [use_fsync] set, then [path] is fsynced
to disk.
It requires that the files existing on disk when the operation is
Expand Down

0 comments on commit e208303

Please sign in to comment.