Skip to content

Commit

Permalink
initialize sched_param using std::mem::zeroed to fix compilation agai…
Browse files Browse the repository at this point in the history
…nst other libc than glibc
  • Loading branch information
padenot committed Aug 19, 2019
1 parent f82fa39 commit a1443a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rt_linux.rs
Expand Up @@ -93,8 +93,8 @@ pub fn promote_current_thread_to_real_time_internal(audio_buffer_frames: u32,
{
let thread_id = unsafe { libc::syscall(libc::SYS_gettid) };
let pthread_id = unsafe { libc::pthread_self() };
let mut param = unsafe { std::mem::zeroed::<libc::sched_param>() };
let mut policy = 0;
let mut param = libc::sched_param { sched_priority: 0 };

if unsafe { libc::pthread_getschedparam(pthread_id, &mut policy, &mut param) } < 0 {
error!("pthread_getschedparam error {}", pthread_id);
Expand Down

0 comments on commit a1443a0

Please sign in to comment.