summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2019-07-29 10:28:09 -0700
committerCommit Bot <commit-bot@chromium.org>2019-07-30 05:35:30 +0000
commitfb32e98f862771388688f0fd678e004a84df1d7d (patch)
treeb7fae0df190d3f3c738744688af0ab99b81260b1
parent2ea297ac76e1d4d3f92f91acabd995a6d7cfaa0b (diff)
downloadcrosvm-fb32e98f862771388688f0fd678e004a84df1d7d.tar
crosvm-fb32e98f862771388688f0fd678e004a84df1d7d.tar.gz
crosvm-fb32e98f862771388688f0fd678e004a84df1d7d.tar.bz2
crosvm-fb32e98f862771388688f0fd678e004a84df1d7d.tar.lz
crosvm-fb32e98f862771388688f0fd678e004a84df1d7d.tar.xz
crosvm-fb32e98f862771388688f0fd678e004a84df1d7d.tar.zst
crosvm-fb32e98f862771388688f0fd678e004a84df1d7d.zip
sys_util: drop redundant empty return type
rustfmt incorrectly formats the `handler` parameter in
register_signal_handler in a way that actually breaks compilation.

This bug has been reported upstream already, but it is not fixed yet on
the version of rustfmt available with stable rust:
https://github.com/rust-lang/rustfmt/issues/3673

However, the empty return type can just be omitted in this case, which
avoids the rustfmt bug.

BUG=None
TEST=`bin/fmt --check` passes with Rust 1.36.0

Change-Id: I75c49c66f1db9cb6ae73cc0f6f3e66351176c474
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1724849
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r--sys_util/src/signal.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys_util/src/signal.rs b/sys_util/src/signal.rs
index 882da90..821f0f6 100644
--- a/sys_util/src/signal.rs
+++ b/sys_util/src/signal.rs
@@ -100,10 +100,7 @@ fn valid_signal_num(num: c_int) -> bool {
 ///
 /// This is considered unsafe because the given handler will be called asynchronously, interrupting
 /// whatever the thread was doing and therefore must only do async-signal-safe operations.
-pub unsafe fn register_signal_handler(
-    num: c_int,
-    handler: extern "C" fn() -> (),
-) -> errno::Result<()> {
+pub unsafe fn register_signal_handler(num: c_int, handler: extern "C" fn()) -> errno::Result<()> {
     if !valid_signal_num(num) {
         return Err(errno::Error::new(EINVAL));
     }