Changeset 23324
- Timestamp:
- 08/01/07 08:38:50 (16 months ago)
- Files:
-
- 1 modified
-
trunk/launchd/src/launchctl.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchctl.c
r23312 r23324 211 211 }; 212 212 213 static bool istty = false; 214 static bool verbose = false; 213 static bool istty; 214 static bool verbose; 215 static bool is_managed; 215 216 216 217 int 217 218 main(int argc, char *const argv[]) 218 219 { 219 int64_t is_managed = 0;220 int64_t is_managed_val = 0; 220 221 char *l; 221 222 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) { 223 228 mach_port_t root_bs = str2bsport("/"); 224 229 task_set_bootstrap_port(mach_task_self(), root_bs); … … 1720 1725 launch_data_array_get_count(lus.pass1) == 0 && 1721 1726 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 } 1723 1730 launch_data_free(lus.pass0); 1724 1731 launch_data_free(lus.pass1); 1725 1732 launch_data_free(lus.pass2); 1726 return 1;1733 return is_managed ? 0 : 1; 1727 1734 } 1728 1735

