Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile with -safe-string #111

Merged
merged 1 commit into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/jbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(executables
((names (xencat))
(libraries (cmdliner lwt vchan vchan-unix))
(flags (:standard -safe-string))
))
1 change: 1 addition & 0 deletions lib/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
(libraries (lwt cstruct io-page mirage-flow-lwt result xenstore.client sexplib))
(c_names (vchan_stubs))
(preprocess (pps (ppx_sexp_conv ppx_cstruct -no-check)))
(flags (:standard -safe-string))
))
1 change: 1 addition & 0 deletions lib_test/jbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(executables
((names (test))
(libraries (cmdliner lwt lwt.unix vchan oUnit io-page.unix))
(flags (:standard -safe-string))
))

(alias
Expand Down
1 change: 1 addition & 0 deletions lwt/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
(libraries (lwt xen-evtchn-unix xen-evtchn xen-gnt-unix xen-gnt io-page.unix xenstore xenstore.client xenstore_transport xenstore_transport.lwt mirage-flow-lwt vchan))
(wrapped false)
(preprocess (pps (ppx_sexp_conv)))
(flags (:standard -safe-string))
))
4 changes: 2 additions & 2 deletions lwt/vchan_lwt_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ module IO = struct
| e -> Lwt.fail e)

let read_exactly ic len =
let buf = String.create len in
let buf = Bytes.create len in
read_exactly ic buf 0 len >>= function
| true -> return (Some buf)
| true -> return (Some (Bytes.to_string buf))
| false -> return None

let write = Lwt_io.write
Expand Down
1 change: 1 addition & 0 deletions xen/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
(libraries (lwt xen-evtchn xen-gnt xenstore xenstore.client mirage-xen mirage-flow-lwt vchan))
(wrapped false)
(preprocess (pps (ppx_sexp_conv)))
(flags (:standard -safe-string))
))