Skip to content

Commit

Permalink
fix: replace WRITE_PIPE_FD with HIGH_PRIORIT_FD in unix get_high_writer
Browse files Browse the repository at this point in the history
  • Loading branch information
kulukami committed Nov 27, 2024
1 parent 312fc4f commit 097681b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/lib/rust/src/sys/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn get_writer() -> Arc<Mutex<BufWriter<File>>> {

pub fn get_high_writer() -> Arc<Mutex<BufWriter<File>>> {
Arc::new(Mutex::new(BufWriter::with_capacity(512 * 1024, unsafe {
File::from_raw_fd(WRITE_PIPE_FD)
File::from_raw_fd(HIGH_PRIORIT_FD)
})))
}

Expand All @@ -37,7 +37,7 @@ pub fn get_reader() -> Arc<Mutex<BufReader<File>>> {
}

extern "C" fn signal_handler(signal: i32) {
eprintln!("catched signal {:?}, exit", signal);
eprintln!("catched signal {:?}, wait 3 seconds and exit", signal);
unsafe {
libc::sleep(3);
libc::close(WRITE_PIPE_FD);
Expand Down

0 comments on commit 097681b

Please sign in to comment.