File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ module Private : sig
108108 val read_link : Fd .t option -> string -> string
109109 val read_link_unix : Unix .file_descr option -> string -> string
110110
111- val chown : flags :int -> uid :int64 -> gid :int64 -> Fd .t option -> string -> unit
112- val chown_unix : flags :int -> uid :int64 -> gid :int64 -> Unix .file_descr option -> string -> unit
111+ val chown : flags :int -> uid :int64 -> gid :int64 -> Fd .t -> string -> unit
112+ val chown_unix : flags :int -> uid :int64 -> gid :int64 -> Unix .file_descr -> string -> unit
113113end
114114
115115module Pi = Pi
Original file line number Diff line number Diff line change @@ -37,9 +37,7 @@ let read_link fd path = Fd.use_exn_opt "readlink" fd (fun fd -> read_link_unix f
3737external eio_fchownat : Unix .file_descr -> string -> int64 -> int64 -> int -> unit = " eio_unix_fchownat"
3838
3939let chown_unix ~flags ~uid ~gid fd path =
40- match fd with
41- | None -> Unix. chown path (Int64. to_int uid) (Int64. to_int gid)
42- | Some fd -> eio_fchownat fd path uid gid flags
40+ eio_fchownat fd path uid gid flags
4341
4442let chown ~flags ~uid ~gid fd path =
45- Fd. use_exn_opt " chown" fd (fun fd -> chown_unix ~uid ~gid ~flags fd path)
43+ Fd. use_exn " chown" fd (fun fd -> chown_unix ~uid ~gid ~flags fd path)
Original file line number Diff line number Diff line change @@ -530,7 +530,7 @@ let chown ~follow ~uid ~gid fd path =
530530 let flags = (follow :> int ) in
531531 try
532532 with_parent_dir_fd fd path @@ fun parent leaf ->
533- Eio_unix. run_in_systhread ~label: " chown" (fun () -> Eio_unix.Private. chown ~flags ~uid ~gid ( Some parent) leaf)
533+ Eio_unix. run_in_systhread ~label: " chown" (fun () -> Eio_unix.Private. chown ~flags ~uid ~gid parent leaf)
534534 with Unix. Unix_error (code , name , arg ) -> raise @@ Err. wrap_fs code name arg
535535
536536(* https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml *)
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ let chown ~follow ~uid ~gid dirfd path =
433433 in_worker_thread " chown" @@ fun () ->
434434 Resolve. with_parent " chown" dirfd path @@ fun dirfd path ->
435435 let dirfd = Option. value dirfd ~default: at_fdcwd in
436- Eio_unix.Private. chown_unix ~flags ~uid ~gid ( Some dirfd) path
436+ Eio_unix.Private. chown_unix ~flags ~uid ~gid dirfd path
437437
438438type stat
439439external create_stat : unit -> stat = " caml_eio_posix_make_stat"
You can’t perform that action at this time.
0 commit comments