Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 108006f3 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Native wakelock: don't crash on failure

In some linux kernel, native wakelock is not supported.  Don't crash;
just log.

Test: run bluetooth on host
Tag: #floss
Bug: 181590011
Change-Id: I677733afaaa9685efea24f871092393cb0b7a23b
parent 398a7116
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ static void wakelock_initialize_native(void) {
  if (wake_lock_fd == INVALID_FD) {
    LOG_ERROR("%s can't open wake lock %s: %s", __func__,
              wake_lock_path.c_str(), strerror(errno));
    CHECK(wake_lock_fd != INVALID_FD);
  }

  if (wake_unlock_path.empty()) wake_unlock_path = DEFAULT_WAKE_UNLOCK_PATH;
@@ -205,7 +204,6 @@ static void wakelock_initialize_native(void) {
  if (wake_unlock_fd == INVALID_FD) {
    LOG_ERROR("%s can't open wake unlock %s: %s", __func__,
              wake_unlock_path.c_str(), strerror(errno));
    CHECK(wake_unlock_fd != INVALID_FD);
  }
}