Projects
Browse Source     Search     Timeline     Wiki

Changeset 23484

Show
Ignore:
Timestamp:
01/16/08 12:56:12 (11 months ago)
Author:
zarzycki@…
Message:

A simple change.

Location:
trunk/launchd/src
Files:
5 modified

Legend:

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

    r23481 r23484  
    7878#define LAUNCHD_CONF ".launchd.conf" 
    7979#define SECURITY_LIB "/System/Library/Frameworks/Security.framework/Versions/A/Security" 
    80 #define SHUTDOWN_LOG_DIR "/var/log/shutdown" 
    8180 
    8281 
     
    9493static void fatal_signal_handler(int sig, siginfo_t *si, void *uap); 
    9594static void handle_pid1_crashes_separately(void); 
    96 static void prep_shutdown_log_dir(void); 
    9795 
    9896static bool re_exec_in_single_user_mode; 
     
    237235} 
    238236 
    239 void 
    240 prep_shutdown_log_dir(void) 
    241 { 
    242         launchd_assumes(mkdir(SHUTDOWN_LOG_DIR, S_IRWXU) != -1 || errno == EEXIST); 
    243 } 
    244  
    245237INTERNAL_ABI void 
    246238launchd_shutdown(void) 
     
    260252                 */ 
    261253                runtime_setlogmask(LOG_UPTO(LOG_DEBUG)); 
    262                 prep_shutdown_log_dir(); 
    263254        } 
    264255 
  • trunk/launchd/src/launchd.h

    r23479 r23484  
    2727#include "launchd_runtime.h" 
    2828 
    29 #define SHUTDOWN_LOG_DIR "/var/log/shutdown" 
    30  
    3129struct kevent; 
    3230struct conncb; 
  • trunk/launchd/src/launchd_core_logic.c

    r23482 r23484  
    9797#define LAUNCHD_SIGKILL_TIMER 5 
    9898 
     99#define SHUTDOWN_LOG_DIR "/var/log/shutdown" 
    99100 
    100101#define TAKE_SUBSET_NAME        "TakeSubsetName" 
     
    715716        } 
    716717 
    717         if (do_apple_internal_logging() && jm->parentmgr == NULL && pid1_magic) { 
     718        if (do_apple_internal_logging && jm->parentmgr == NULL && pid1_magic) { 
    718719                runtime_set_timeout(still_alive_with_check, 5); 
    719720        } 
     
    48634864        pid_t sp; 
    48644865 
    4865         if (!do_apple_internal_logging()) { 
     4866        if (!do_apple_internal_logging) { 
    48664867                return; 
    48674868        } 
    48684869         
     4870        if (!job_assumes(j, mkdir(SHUTDOWN_LOG_DIR, S_IRWXU) != -1 || errno == EEXIST)) { 
     4871                return; 
     4872        } 
     4873 
    48694874        snprintf(pidstr, sizeof(pidstr), "%u", j->p); 
    48704875        snprintf(logfile, sizeof(logfile), SHUTDOWN_LOG_DIR "/%s-%u.sample.txt", j->label, j->p); 
  • trunk/launchd/src/launchd_runtime.c

    r23483 r23484  
    122122static FILE *ourlogfile; 
    123123bool pid1_magic; 
     124bool do_apple_internal_logging; 
     125 
    124126 
    125127INTERNAL_ABI mach_port_t 
     
    11461148{ 
    11471149#if 0 
    1148         if (do_apple_internal_logging()) { 
     1150        if (do_apple_internal_logging) { 
    11491151                return fcntl(fd, F_FULLFSYNC, NULL); 
    11501152        } else { 
     
    11881190 
    11891191        if (attr->priority == LOG_APPLEONLY) { 
    1190                 if (do_apple_internal_logging()) { 
     1192                if (do_apple_internal_logging) { 
    11911193                        attr->priority = LOG_NOTICE; 
    11921194                } else { 
     
    15531555} 
    15541556 
    1555 INTERNAL_ABI bool 
    1556 do_apple_internal_logging(void) 
    1557 { 
    1558         static int apple_internal_logging = 1; 
    1559         struct stat sb; 
    1560  
    1561         if (unlikely(apple_internal_logging == 1)) { 
    1562                 apple_internal_logging = stat("/AppleInternal", &sb); 
    1563         } 
    1564  
    1565         return (apple_internal_logging == 0); 
    1566 } 
    1567  
    15681557INTERNAL_ABI int64_t 
    15691558runtime_get_wall_time(void) 
     
    16131602do_file_init(void) 
    16141603{ 
     1604        struct stat sb; 
     1605 
    16151606        launchd_assert(mach_timebase_info(&tbi) == 0); 
    16161607        tbi_float_val = tbi.numer; 
     
    16201611                pid1_magic = true; 
    16211612        } 
    1622 } 
     1613 
     1614        if (stat("/AppleInternal", &sb) != -1) { 
     1615                do_apple_internal_logging = true; 
     1616        } 
     1617} 
  • trunk/launchd/src/launchd_runtime.h

    r23481 r23484  
    105105 
    106106extern bool pid1_magic; 
     107extern bool do_apple_internal_logging; 
    107108 
    108109INTERNAL_ABI mach_port_t runtime_get_kernel_port(void); 
     
    130131INTERNAL_ABI const char *reboot_flags_to_C_names(unsigned int flags); 
    131132INTERNAL_ABI const char *proc_flags_to_C_names(unsigned int flags); 
    132  
    133 INTERNAL_ABI bool do_apple_internal_logging(void); 
    134133 
    135134INTERNAL_ABI int kevent_bulk_mod(struct kevent *kev, size_t kev_cnt);