mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[platform] launcher: making vfprintf hook return a number of processed bytes
..., lest JVM drop incomprehensible "Could not write log" message and shut up GitOrigin-RevId: cfe19e77c127e9b88e53b7f4ec82e1661bc4c6b1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e9054668cb
commit
4cb3f4c389
@@ -47,11 +47,11 @@ extern "C" fn vfprintf_hook(fp: *const c_void, format: *const c_char, args: va_l
|
||||
None => unsafe { vfprintf(fp, format, args) },
|
||||
Some(messages) => {
|
||||
let mut buffer = [0; 4096];
|
||||
let _ = unsafe { vsnprintf(buffer.as_mut_ptr(), buffer.len(), format, args) };
|
||||
let len = unsafe { vsnprintf(buffer.as_mut_ptr(), buffer.len(), format, args) };
|
||||
let message = unsafe { CStr::from_ptr(buffer.as_ptr()) }.to_string_lossy().to_string();
|
||||
debug!("[JVM] vfprintf_hook: {:?}", message);
|
||||
messages.push(message);
|
||||
0 // because nothing was actually printed
|
||||
len
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user