Skip to content

Commit d7c3249

Browse files
authored
Merge pull request #5 from jjs-dev/musl
Fix building on musl
2 parents 30ca595 + 3f6eed4 commit d7c3249

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/rust.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ jobs:
3333
run: |
3434
rm -rf .cargo
3535
cargo clippy --workspace -- -Dclippy::all
36+
check-platform-support:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions-rs/toolchain@v1.0.6
41+
with:
42+
toolchain: stable
43+
- name: Remove cargo config
44+
run: rm -rf .cargo
45+
- name: Check musl
46+
run: |
47+
rustup target add x86_64-unknown-linux-musl
48+
cargo check --workspace --target x86_64-unknown-linux-musl
3649
tests:
3750
runs-on: ubuntu-latest
3851
steps:

src/linux/zygote.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,15 @@ fn timed_wait(pid: Pid, timeout: Option<time::Duration>) -> crate::Result<Option
303303
end_r = 0;
304304
end_w = 0;
305305
setup_pipe(&mut end_r, &mut end_w)?;
306-
let waiter_pid;
306+
let mut waiter_pid: libc::pthread_t = unsafe { std::mem::zeroed() };
307307
{
308308
let mut arg = WaiterArg { res_fd: end_w, pid };
309-
let mut wpid = 0;
310309
let ret = libc::pthread_create(
311-
&mut wpid as *mut _,
310+
&mut waiter_pid as *mut _,
312311
ptr::null(),
313312
timed_wait_waiter,
314313
&mut arg as *mut WaiterArg as *mut c_void,
315314
);
316-
waiter_pid = wpid;
317315
if ret != 0 {
318316
errno::set_errno(errno::Errno(ret));
319317
err_exit("pthread_create");

0 commit comments

Comments
 (0)