From f4a0f3f2a36be0e6986ccc476ccf27d28e7f5e88 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Fri, 29 Sep 2023 15:31:43 +0200 Subject: [PATCH] Fix building on musl (#34) #33 introduced a compile error when targeting (at least) `-musl` but possibly other unixes. --- src/utils/flock/unix.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/flock/unix.rs b/src/utils/flock/unix.rs index 0808edc..2809105 100644 --- a/src/utils/flock/unix.rs +++ b/src/utils/flock/unix.rs @@ -83,7 +83,7 @@ pub(super) fn lock(file: &File, state: LockState, timeout: Option) -> // nice, so we use a simpler approach of just spawning a thread and sending // a signal to it ourselves. Less efficient probably, but IMO cleaner let file_ptr = file as *const _ as usize; - let mut thread_id: libc::pthread_t = 0; + let mut thread_id: libc::pthread_t = unsafe { std::mem::zeroed() }; let tid = &mut thread_id as *mut _ as usize; let (tx, rx) = std::sync::mpsc::channel(); let lock_thread = std::thread::Builder::new()