Skip to content

Commit

Permalink
Fix eio_linux
Browse files Browse the repository at this point in the history
  • Loading branch information
patricoferris committed Apr 1, 2024
1 parent 4845ec0 commit 7ec85fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib_eio_linux/eio_linux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ end = struct
| Some fd2 -> Low_level.rename t.fd old_path fd2 new_path
| None -> raise (Unix.Unix_error (Unix.EXDEV, "rename-dst", new_path))

let symlink t old_path new_path =
Low_level.symlink old_path t.fd new_path
let symlink t path ~link_to =
Low_level.symlink link_to t.fd path

let pp f t = Fmt.string f (String.escaped t.label)

Expand Down
6 changes: 3 additions & 3 deletions lib_eio_linux/low_level.ml
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,10 @@ let rename old_dir old_path new_dir new_path =
new_parent new_leaf
with Unix.Unix_error (code, name, arg) -> raise @@ Err.wrap_fs code name arg

let symlink old_path new_dir new_path =
with_parent_dir "renameat-new" new_dir new_path @@ fun new_parent new_leaf ->
let symlink link_to dir path =
with_parent_dir "symlinkat-new" dir path @@ fun parent leaf ->
try
eio_symlinkat old_path new_parent new_leaf
eio_symlinkat link_to parent leaf
with Unix.Unix_error (code, name, arg) -> raise @@ Err.wrap_fs code name arg

let shutdown socket command =
Expand Down
2 changes: 1 addition & 1 deletion lib_eio_linux/low_level.mli
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ val rename : dir_fd -> string -> dir_fd -> string -> unit
(** [rename old_dir old_path new_dir new_path] renames [old_dir / old_path] as [new_dir / new_path]. *)

val symlink : string -> dir_fd -> string -> unit
(** [symlink old_path dir new_path] symlinks to [dir / old_path] as [dir / new_path]. *)
(** [symlink link_to dir path] creates a new symlink at [dir / path] pointing to [link_to]. *)

val pipe : sw:Switch.t -> fd * fd
(** [pipe ~sw] returns a pair [r, w] with the readable and writeable ends of a new pipe. *)
Expand Down

0 comments on commit 7ec85fe

Please sign in to comment.