Changeset 23542
- Timestamp:
- 03/06/08 16:20:27 (9 months ago)
- Location:
- trunk/launchd/src
- Files:
-
- 4 modified
-
launchd.c (modified) (1 diff)
-
launchd_runtime.c (modified) (4 diffs)
-
launchd_runtime.h (modified) (1 diff)
-
liblaunch.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd.c
r23507 r23542 107 107 main(int argc, char *const *argv) 108 108 { 109 const char *stdouterr_path = low_level_debug ? _PATH_CONSOLE : _PATH_DEVNULL; 109 110 bool sflag = false; 110 111 int ch; 111 112 112 113 testfd_or_openfd(STDIN_FILENO, _PATH_DEVNULL, O_RDONLY); 113 testfd_or_openfd(STDOUT_FILENO, _PATH_DEVNULL, O_WRONLY);114 testfd_or_openfd(STDERR_FILENO, _PATH_DEVNULL, O_WRONLY);114 testfd_or_openfd(STDOUT_FILENO, stdouterr_path, O_WRONLY); 115 testfd_or_openfd(STDERR_FILENO, stdouterr_path, O_WRONLY); 115 116 116 117 while ((ch = getopt(argc, argv, "s")) != -1) { -
trunk/launchd/src/launchd_runtime.c
r23535 r23542 125 125 bool pid1_magic; 126 126 bool do_apple_internal_logging; 127 bool low_level_debug; 127 128 128 129 … … 136 137 137 138 static int internal_mask_pri = LOG_UPTO(LOG_NOTICE); 138 //static int internal_mask_pri = LOG_UPTO(LOG_DEBUG);139 139 140 140 … … 1206 1206 1207 1207 vsnprintf(newmsg, sizeof(newmsg), message, args); 1208 1209 if (unlikely(low_level_debug)) { 1210 fprintf(stderr, "%s %u\t%s %u\t%s\n", attr->from_name, attr->from_pid, 1211 attr->about_name, attr->about_pid, newmsg); 1212 } 1213 1208 1214 logmsg_add(attr, saved_errno, newmsg); 1209 1215 } … … 1651 1657 do_apple_internal_logging = true; 1652 1658 } 1653 } 1659 1660 if (stat("/var/db/.debug_launchd", &sb) == 0) { 1661 internal_mask_pri = LOG_UPTO(LOG_DEBUG); 1662 low_level_debug = true; 1663 } 1664 } -
trunk/launchd/src/launchd_runtime.h
r23519 r23542 106 106 extern bool pid1_magic; 107 107 extern bool do_apple_internal_logging; 108 extern bool low_level_debug; 108 109 109 110 INTERNAL_ABI mach_port_t runtime_get_kernel_port(void); -
trunk/launchd/src/liblaunch.c
r23462 r23542 733 733 } 734 734 735 int launchd_msg_send(launch_t lh, launch_data_t d) 735 int 736 launchd_msg_send(launch_t lh, launch_data_t d) 736 737 { 737 738 struct launch_msg_header lmh; … … 949 950 } 950 951 951 int launchd_msg_recv(launch_t lh, void (*cb)(launch_data_t, void *), void *context) 952 int 953 launchd_msg_recv(launch_t lh, void (*cb)(launch_data_t, void *), void *context) 952 954 { 953 955 struct cmsghdr *cm = alloca(4096); … … 1040 1042 } 1041 1043 1042 launch_data_t launch_data_copy(launch_data_t o) 1044 launch_data_t 1045 launch_data_copy(launch_data_t o) 1043 1046 { 1044 1047 launch_data_t r = launch_data_alloc(o->type); … … 1091 1094 } 1092 1095 1093 static int _fd(int fd) 1096 int 1097 _fd(int fd) 1094 1098 { 1095 1099 if (fd >= 0) … … 1098 1102 } 1099 1103 1100 launch_data_t launch_data_new_errno(int e) 1104 launch_data_t 1105 launch_data_new_errno(int e) 1101 1106 { 1102 1107 launch_data_t r = launch_data_alloc(LAUNCH_DATA_ERRNO); … … 1108 1113 } 1109 1114 1110 launch_data_t launch_data_new_fd(int fd) 1115 launch_data_t 1116 launch_data_new_fd(int fd) 1111 1117 { 1112 1118 launch_data_t r = launch_data_alloc(LAUNCH_DATA_FD); … … 1118 1124 } 1119 1125 1120 launch_data_t launch_data_new_machport(mach_port_t p) 1126 launch_data_t 1127 launch_data_new_machport(mach_port_t p) 1121 1128 { 1122 1129 launch_data_t r = launch_data_alloc(LAUNCH_DATA_MACHPORT); … … 1128 1135 } 1129 1136 1130 launch_data_t launch_data_new_integer(long long n) 1137 launch_data_t 1138 launch_data_new_integer(long long n) 1131 1139 { 1132 1140 launch_data_t r = launch_data_alloc(LAUNCH_DATA_INTEGER); … … 1138 1146 } 1139 1147 1140 launch_data_t launch_data_new_bool(bool b) 1148 launch_data_t 1149 launch_data_new_bool(bool b) 1141 1150 { 1142 1151 launch_data_t r = launch_data_alloc(LAUNCH_DATA_BOOL); … … 1148 1157 } 1149 1158 1150 launch_data_t launch_data_new_real(double d) 1159 launch_data_t 1160 launch_data_new_real(double d) 1151 1161 { 1152 1162 launch_data_t r = launch_data_alloc(LAUNCH_DATA_REAL); … … 1158 1168 } 1159 1169 1160 launch_data_t launch_data_new_string(const char *s) 1170 launch_data_t 1171 launch_data_new_string(const char *s) 1161 1172 { 1162 1173 launch_data_t r = launch_data_alloc(LAUNCH_DATA_STRING); … … 1173 1184 } 1174 1185 1175 launch_data_t launch_data_new_opaque(const void *o, size_t os) 1186 launch_data_t 1187 launch_data_new_opaque(const void *o, size_t os) 1176 1188 { 1177 1189 launch_data_t r = launch_data_alloc(LAUNCH_DATA_OPAQUE);

