Skip to content

Commit b50df02

Browse files
committed
checkpoint: fix memfd_create c_char portability; drop m1/em-dash from build warnings
Signed-off-by: Cong Wang <cwang@multikernel.io>
1 parent b620859 commit b50df02

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

crates/sandlock-core/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn main() {
1313
&repo_root.join("tests/rootfs-helper"),
1414
&["musl-gcc", "cc"],
1515
&["-static", "-O2"],
16-
"cannot compile tests/rootfs-helper chroot tests will fail. \
16+
"cannot compile tests/rootfs-helper: chroot tests will fail. \
1717
Install musl-tools or static libc.",
1818
);
1919

@@ -29,7 +29,7 @@ fn main() {
2929
&stub_bin,
3030
&["cc"],
3131
&["-static", "-nostdlib", "-no-pie", "-O2"],
32-
"cannot compile restore-stub — M1 restore-stub tests will be skipped.",
32+
"cannot compile restore-stub: its restore tests will be skipped.",
3333
);
3434
// Emit the path every run (rustc-env is not cached across build-script runs),
3535
// whether or not the binary was just (re)built.

crates/sandlock-core/src/checkpoint/restore-stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* restore-stub freestanding self-restore stub (x86_64).
2+
* restore-stub: freestanding self-restore stub (x86_64).
33
*
44
* This is a core component of the checkpoint restore engine, not a test
55
* fixture: the supervisor execs this stub into a fresh, fully-sandboxed process

crates/sandlock-core/tests/integration/test_restore_stub.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn eventfd() -> RawFd {
115115

116116
fn memfd_with(bytes: &[u8]) -> RawFd {
117117
let name = b"restore-blob\0";
118-
let fd = unsafe { libc::memfd_create(name.as_ptr() as *const i8, 0) } as i32;
118+
let fd = unsafe { libc::memfd_create(name.as_ptr() as *const libc::c_char, 0) } as i32;
119119
assert!(fd >= 0, "memfd_create");
120120
let mut off = 0usize;
121121
while off < bytes.len() {

0 commit comments

Comments
 (0)