Projects
Browse Source     Search     Timeline     Wiki

Changeset 23324

Show
Ignore:
Timestamp:
08/01/07 08:38:50 (16 months ago)
Author:
zarzycki@…
Message:

<rdar://problem/5374857> launchd unnecessarily logs a warning when there is nothing to load in StandardIO

Files:
1 modified

Legend:

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

    r23312 r23324  
    211211}; 
    212212 
    213 static bool istty = false; 
    214 static bool verbose = false; 
     213static bool istty; 
     214static bool verbose; 
     215static bool is_managed; 
    215216 
    216217int 
    217218main(int argc, char *const argv[]) 
    218219{ 
    219         int64_t is_managed = 0; 
     220        int64_t is_managed_val = 0; 
    220221        char *l; 
    221222 
    222         if ((getuid() == 0) && (vproc_swap_integer(NULL, VPROC_GSK_IS_MANAGED, NULL, &is_managed) == NULL) && (is_managed == 0)) { 
     223        if (vproc_swap_integer(NULL, VPROC_GSK_IS_MANAGED, NULL, &is_managed_val) == NULL && is_managed_val) { 
     224                is_managed = true; 
     225        } 
     226 
     227        if (getuid() && !is_managed) { 
    223228                mach_port_t root_bs = str2bsport("/"); 
    224229                task_set_bootstrap_port(mach_task_self(), root_bs); 
     
    17201725                        launch_data_array_get_count(lus.pass1) == 0 && 
    17211726                        launch_data_array_get_count(lus.pass2) == 0) { 
    1722                 fprintf(stderr, "nothing found to %s\n", lus.load ? "load" : "unload"); 
     1727                if (!is_managed) { 
     1728                        fprintf(stderr, "nothing found to %s\n", lus.load ? "load" : "unload"); 
     1729                } 
    17231730                launch_data_free(lus.pass0); 
    17241731                launch_data_free(lus.pass1); 
    17251732                launch_data_free(lus.pass2); 
    1726                 return 1; 
     1733                return is_managed ? 0 : 1; 
    17271734        } 
    17281735