MCPcopy Create free account
hub / github.com/apache/httpd / cgid_start

Function cgid_start

modules/generators/mod_cgid.c:1002–1026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1000}
1001
1002static int cgid_start(apr_pool_t *p, server_rec *main_server,
1003 apr_proc_t *procnew)
1004{
1005
1006 daemon_should_exit = 0; /* clear setting from previous generation */
1007 if ((daemon_pid = fork()) < 0) {
1008 ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, APLOGNO(01253)
1009 "mod_cgid: Couldn't spawn cgid daemon process");
1010 return DECLINED;
1011 }
1012 else if (daemon_pid == 0) {
1013 if (pcgi == NULL) {
1014 apr_pool_create(&pcgi, p);
1015 apr_pool_tag(pcgi, "cgid_pcgi");
1016 }
1017 exit(cgid_server(main_server) > 0 ? DAEMON_STARTUP_ERROR : -1);
1018 }
1019 procnew->pid = daemon_pid;
1020 procnew->err = procnew->in = procnew->out = NULL;
1021 apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);
1022#if APR_HAS_OTHER_CHILD
1023 apr_proc_other_child_register(procnew, cgid_maint, procnew, NULL, p);
1024#endif
1025 return OK;
1026}
1027
1028static int cgid_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
1029 apr_pool_t *ptemp)

Callers 2

cgid_maintFunction · 0.85
cgid_initFunction · 0.85

Calls 2

cgid_serverFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected