#ifdef TPF
int tpf_child = 0;
char tpf_server_name[INETD_SERVNAME_LENGTH+1];
+char tpf_mutex_key[TPF_MUTEX_KEY_SIZE];
#endif /* TPF */
scoreboard *ap_scoreboard_image = NULL;
static void accept_mutex_cleanup_tpfcore(void *foo)
{
if(tpf_core_held)
- coruc(RESOURCE_KEY);
+ deqc(tpf_mutex_key, QUAL_S);
}
#define accept_mutex_init_tpfcore(x)
static void accept_mutex_on_tpfcore(void)
{
- corhc(RESOURCE_KEY);
+ enqc(tpf_mutex_key, ENQ_WAIT, 0, QUAL_S);
tpf_core_held = 1;
ap_check_signals();
}
static void accept_mutex_off_tpfcore(void)
{
- coruc(RESOURCE_KEY);
+ deqc(tpf_mutex_key, QUAL_S);
tpf_core_held = 0;
ap_check_signals();
}
memcpy(tpf_server_name, input_parms.parent.servname,
INETD_SERVNAME_LENGTH);
tpf_server_name[INETD_SERVNAME_LENGTH + 1] = '\0';
+ sprintf(tpf_mutex_key, "%.*x", TPF_MUTEX_KEY_SIZE - 1, getpid());
ap_open_logs(server_conf, plog);
ap_tpf_zinet_checks(ap_standalone, tpf_server_name, server_conf);
ap_tpf_save_argv(argc, argv); /* save argv parms for children */
free(idct);
} else {
ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, s,
- TPF_UNABLE_TO_DETERMINE_ZINET_MODEL);
+ TPF_UNABLE_TO_DETERMINE_ZINET_MODEL, servername);
exit(1); /* abort start-up of server */
}
}
void os_tpf_child(APACHE_TPF_INPUT *input_parms) {
+ extern char tpf_mutex_key[TPF_MUTEX_KEY_SIZE];
+
tpf_child = 1;
ap_my_generation = input_parms->generation;
ap_restart_time = input_parms->restart_time;
tpf_fds = input_parms->tpf_fds;
tpf_shm_static_ptr = input_parms->shm_static_ptr;
+ sprintf(tpf_mutex_key, "%.*x", TPF_MUTEX_KEY_SIZE - 1, getppid());
}
#ifndef __PIPE_
#define FD_SET(n, p) (0)
#endif
-#define RESOURCE_KEY ((void*) 0xC1C2C1C3)
+#define TPF_MUTEX_KEY_SIZE (sizeof(pid_t)*2+1)
/* TPF doesn't have, or need, tzset (it is used in mod_expires.c) */
#define tzset()
#endif
#define TPF_UNABLE_TO_DETERMINE_ZINET_MODEL \
- "Unable to determine ZINET model: inetd_getServer call failed" \
- " -- Apache startup aborted"
+ "Unable to determine ZINET model: inetd_getServer(\"%s\") " \
+ "call failed -- Apache startup aborted"
#endif /*! APACHE_OS_H*/