Fix side effect for 604058d2539209cf9d75dcdba6ea32a965bded90 12/225412/1
authorInkyun Kil <inkyun.kil@samsung.com>
Wed, 19 Feb 2020 23:57:17 +0000 (08:57 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Wed, 19 Feb 2020 23:57:17 +0000 (08:57 +0900)
Change-Id: I380c5211da2bf202429c2d21f6ee2895a57ce228
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
server/alarm-manager.c

index bcd4bce..0824bca 100644 (file)
@@ -2068,9 +2068,9 @@ int alarm_manager_alarm_set_time(GVariant* parameters, pid_t pid)
        clock_gettime(CLOCK_REALTIME, &cur_time);
 
        accrue_nsec += (cur_time.tv_nsec / MILLION); /* Accrue the nanosecond to compensate the time */
-       if (accrue_nsec > (BILLION / 2)) { /* Over 500ms */
+       if (accrue_nsec > 500) { /* Over 500ms */
                diff_time = difftime(new_time, cur_time.tv_sec) - 1;
-               accrue_nsec -= BILLION;
+               accrue_nsec -= 1000;
        } else {
                diff_time = difftime(new_time, cur_time.tv_sec);
        }