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

Commit 88e0fe62 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Add extra log if timer_create(CLOCK_BOOTTIME_ALARM) fails

Add explicit log messages if timer_create(CLOCK_BOOTTIME_ALARM)
fails. The most likely reason is the kernel doesn't have
the appropriate patches.

Bug: 25739638
Change-Id: Icbeaa965d729ba11dfb7cfbb6185b1655b3c6de4
parent 562f044b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -659,6 +659,10 @@ static bool timer_create_internal(const clockid_t clock_id, timer_t *timer) {
  if (timer_create(clock_id, &sigevent, timer) == -1) {
    LOG_ERROR(LOG_TAG, "%s unable to create timer with clock %d: %s",
              __func__, clock_id, strerror(errno));
    if (clock_id == CLOCK_BOOTTIME_ALARM) {
      LOG_ERROR(LOG_TAG, "The kernel might not have support for timer_create(CLOCK_BOOTTIME_ALARM): https://lwn.net/Articles/429925/");
      LOG_ERROR(LOG_TAG, "See following patches: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=CLOCK_BOOTTIME_ALARM");
    }
    return false;
  }