mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
rust-agent: Ignore write errors while writing to the logs
When we are writing to the logs and there is an error doing so, there is not much we can do. Chances are that a panic would make things worse. So let it go through. warning: unused `std::result::Result` that must be used --> rustjail/src/sync.rs:26:9 | 26 | write_count(lfd, log_str.as_bytes(), log_str.len()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ::: rustjail/src/container.rs:339:13 | 339 | log_child!(cfd_log, "child exit: {:?}", e); | ------------------------------------------- in this macro invocation | = note: this `Result` may be an `Err` variant, which should be handled = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) Fixes: #750 Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
This commit is contained in:
parent
c635c46a4b
commit
d5b492a1e7
@ -23,7 +23,8 @@ macro_rules! log_child {
|
||||
let lfd = $fd;
|
||||
let mut log_str = format_args!($($arg)+).to_string();
|
||||
log_str.push('\n');
|
||||
write_count(lfd, log_str.as_bytes(), log_str.len());
|
||||
// Ignore error writing to the logger, not much we can do
|
||||
let _ = write_count(lfd, log_str.as_bytes(), log_str.len());
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user