Projects
Browse Source     Search     Timeline     Wiki

Changeset 23276

Show
Ignore:
Timestamp:
06/08/07 14:11:59 (18 months ago)
Author:
zarzycki@…
Message:

Small bug fixes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchd_core_logic.c

    r23275 r23276  
    27282728calendarinterval_setalarm(job_t j, struct calendarinterval *ci) 
    27292729{ 
    2730         static time_t last_list_head_when; 
    27312730        struct calendarinterval *ci_iter, *ci_prev = NULL; 
    2732         time_t later; 
     2731        time_t later, head_later; 
    27332732 
    27342733        later = cronemu(ci->when.tm_mon, ci->when.tm_mday, ci->when.tm_hour, ci->when.tm_min); 
     
    27652764        } 
    27662765 
    2767         if (last_list_head_when == LIST_FIRST(&sorted_calendar_events)->when_next) { 
    2768                 return; 
    2769         } 
    2770  
    2771         last_list_head_when = LIST_FIRST(&sorted_calendar_events)->when_next; 
    2772  
    2773         if (job_assumes(j, kevent_mod((uintptr_t)&sorted_calendar_events, EVFILT_TIMER, EV_ADD, NOTE_ABSOLUTE|NOTE_SECONDS, last_list_head_when, root_jobmgr) != -1)) { 
     2766        head_later = LIST_FIRST(&sorted_calendar_events)->when_next; 
     2767 
     2768        /* Workaround 5225889 */ 
     2769        kevent_mod((uintptr_t)&sorted_calendar_events, EVFILT_TIMER, EV_DELETE, 0, 0, root_jobmgr); 
     2770 
     2771        if (job_assumes(j, kevent_mod((uintptr_t)&sorted_calendar_events, EVFILT_TIMER, EV_ADD, NOTE_ABSOLUTE|NOTE_SECONDS, head_later, root_jobmgr) != -1)) { 
    27742772                char time_string[100]; 
    27752773                size_t time_string_len; 
     
    31573155        time_t now = time(NULL); 
    31583156 
    3159         if (ci && ci->when_next < now) { 
     3157        if (ci && (ci->when_next < now)) { 
    31603158                jobmgr_assumes(root_jobmgr, kill(getpid(), SIGUSR1) != -1); 
    31613159        } 
     
    31713169                job_t j = ci->job; 
    31723170 
    3173                 if (ci->when_next >= now) { 
     3171                if (ci->when_next > now) { 
    31743172                        break; 
    31753173                } 
     
    34543452        } 
    34553453 
    3456         if (j->start_pending && j->start_time == 0) { 
    3457                 job_log(j, LOG_DEBUG, "KeepAlive check: job needs to run at least once."); 
     3454        if (j->start_pending) { 
     3455                job_log(j, LOG_DEBUG, "KeepAlive check: Pent-up non-IPC launch criteria."); 
    34583456                return true; 
    34593457        }