Projects
Browse Source     Search     Timeline     Wiki

Changeset 23630

Show
Ignore:
Timestamp:
2008-05-21 16:25:49 (3 months ago)
Author:
zarzycki@…
Message:

Misc.

Location:
trunk/launchd/src
Files:
2 modified

Legend:

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

    r23628 r23630  
    389389        unsigned int exit_timeout; 
    390390        int stdout_err_fd; 
    391         uint64_t sent_sigterm_time; 
     391        uint64_t sent_signal_time; 
    392392        uint64_t start_time; 
    393393        uint32_t min_run_time; 
     
    633633        } 
    634634 
    635         j->sent_sigterm_time = runtime_get_opaque_time(); 
     635        j->sent_signal_time = runtime_get_opaque_time(); 
    636636 
    637637        if (newval < 0) { 
     
    663663 
    664664                if (j->kill_via_shmem) { 
    665                         snprintf(extralog, sizeof(extralog), ": %d remaining transactions", j->shmem->vp_shmem_transaction_cnt + 1); 
     665                        snprintf(extralog, sizeof(extralog), ": %d remaining transactions", newval + 1); 
    666666                } else { 
    667667                        extralog[0] = '\0'; 
     
    24042404        } 
    24052405 
    2406         if (j->sent_sigterm_time) { 
    2407                 uint64_t td_sec, td_usec, td = runtime_get_nanoseconds_since(j->sent_sigterm_time); 
     2406        if (j->sent_signal_time) { 
     2407                uint64_t td_sec, td_usec, td = runtime_get_nanoseconds_since(j->sent_signal_time); 
    24082408 
    24092409                td_sec = td / NSEC_PER_SEC; 
    24102410                td_usec = (td % NSEC_PER_SEC) / NSEC_PER_USEC; 
    24112411 
    2412                 job_log(j, LOG_INFO, "Exited %lld.%06lld seconds after %s was sent", td_sec, td_usec, signal_to_C_name(SIGTERM)); 
     2412                job_log(j, LOG_INFO, "Exited %llu.%06llu seconds after the first signal was sent", td_sec, td_usec); 
    24132413        } 
    24142414 
     
    24492449        } 
    24502450        j->last_exit_status = status; 
     2451        j->sent_signal_time = 0; 
    24512452        j->sent_sigkill = false; 
    24522453        j->sampled = false; 
     
    27082709                 */ 
    27092710                if (j->sent_sigkill) { 
    2710                         uint64_t td = runtime_get_nanoseconds_since(j->sent_sigterm_time); 
     2711                        uint64_t td = runtime_get_nanoseconds_since(j->sent_signal_time); 
    27112712 
    27122713                        td /= NSEC_PER_SEC; 
     
    28892890                return; 
    28902891        } 
    2891  
    2892         j->sent_sigterm_time = 0; 
    28932892 
    28942893        if (likely(!j->legacy_mach_job)) { 
     
    52525251        pid_t sp; 
    52535252 
    5254         if (j->sampled) { 
     5253        if (j->sampled || j->per_user) { 
    52555254                return; 
    52565255        } 
     5256 
    52575257        j->sampled = true; 
    52585258 
     
    70407040job_mig_set_service_policy(job_t j, pid_t target_pid, uint64_t flags, name_t target_service) 
    70417041{ 
     7042        struct ldcred *ldc = runtime_get_caller_creds(); 
    70427043        job_t target_j; 
    70437044 
    70447045        if (!launchd_assumes(j != NULL)) { 
    70457046                return BOOTSTRAP_NO_MEMORY; 
     7047        } 
     7048 
     7049        if (unlikely(ldc->euid || ldc->uid)) { 
     7050                return BOOTSTRAP_NOT_PRIVILEGED; 
    70467051        } 
    70477052 
  • trunk/launchd/src/reboot2.h

    r23073 r23630  
    2727__BEGIN_DECLS 
    2828 
     29#define RB2_FULLREBOOT  0x8000000000000000llu 
     30 
    2931/* Returns NULL on success. Not NULL on failure */ 
    3032