mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
Print error when netlink socket not created.
The panic here didn't show what error might be encountered (EPERM, for instance). Bug: 228077254 Test: check log on error Change-Id: I56f34f87430a68266af85ba1d0abb2aeb2c05407 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3569267 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Andrew Walbran <qwandor@google.com> Commit-Queue: Steven Moreland <smoreland@google.com>
This commit is contained in:
parent
5b8a837485
commit
070407809e
1 changed files with 7 additions and 1 deletions
|
@ -320,7 +320,13 @@ fn acpi_event_pwrbtn_class(
|
||||||
|
|
||||||
fn get_acpi_event_group() -> Option<u32> {
|
fn get_acpi_event_group() -> Option<u32> {
|
||||||
// Create netlink generic socket which will be used to query about given family name
|
// Create netlink generic socket which will be used to query about given family name
|
||||||
let netlink_ctrl_sock = NetlinkGenericSocket::new(0).unwrap();
|
let netlink_ctrl_sock = match NetlinkGenericSocket::new(0) {
|
||||||
|
Ok(sock) => sock,
|
||||||
|
Err(e) => {
|
||||||
|
error!("netlink generic socket creation error: {}", e);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let nlmsg_family_response = netlink_ctrl_sock
|
let nlmsg_family_response = netlink_ctrl_sock
|
||||||
.family_name_query("acpi_event".to_string())
|
.family_name_query("acpi_event".to_string())
|
||||||
|
|
Loading…
Reference in a new issue