ap_status_t rc;
ap_table_t *env = r->subprocess_env;
char **argv;
- ap_file_t *file;
+ ap_file_t *file = NULL;
ap_iol *iol;
arg.r = r;
static int send_parsed_file(request_rec *r)
{
- ap_file_t *f;
+ ap_file_t *f = NULL;
enum xbithack *state =
(enum xbithack *) ap_get_module_config(r->per_dir_config, &includes_module);
int errstatus;
static int asis_handler(request_rec *r)
{
- ap_file_t *f;
+ ap_file_t *f = NULL;
ap_status_t status;
const char *location;
static void emit_head(request_rec *r, char *header_fname, int suppress_amble,
char *title)
{
- ap_file_t *f;
+ ap_file_t *f = NULL;
request_rec *rr = NULL;
int emit_amble = 1;
int emit_H1 = 1;
*/
static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble)
{
- ap_file_t *f;
+ ap_file_t *f = NULL;
request_rec *rr = NULL;
int suppress_post = 0;
int suppress_sig = 0;
static int log_scripterror(request_rec *r, cgi_server_conf * conf, int ret,
int show_errno, char *error)
{
- ap_file_t *f;
+ ap_file_t *f = NULL;
struct stat finfo;
ap_log_rerror(APLOG_MARK, show_errno|APLOG_ERR, errno, r,
ap_array_header_t *hdrs_arr = ap_table_elts(r->headers_in);
ap_table_entry_t *hdrs = (ap_table_entry_t *) hdrs_arr->elts;
char argsbuffer[HUGE_STRING_LEN];
- ap_file_t *f;
+ ap_file_t *f = NULL;
int i;
struct stat finfo;
ap_procattr_t *procattr;
ap_proc_t *procnew;
ap_status_t rc = APR_SUCCESS;
- ap_file_t *file;
+ ap_file_t *file = NULL;
ap_iol *iol;
#ifdef DEBUG_CGI
static int log_scripterror(request_rec *r, cgid_server_conf * conf, int ret,
int show_errno, char *error)
{
- ap_file_t *f;
+ ap_file_t *f = NULL;
struct stat finfo;
ap_log_rerror(APLOG_MARK, show_errno|APLOG_ERR, errno, r,
ap_array_header_t *hdrs_arr = ap_table_elts(r->headers_in);
ap_table_entry_t *hdrs = (ap_table_entry_t *) hdrs_arr->elts;
char argsbuffer[HUGE_STRING_LEN];
- ap_file_t *f;
+ ap_file_t *f = NULL;
int i;
struct stat finfo;
static int read_type_map(negotiation_state *neg, request_rec *rr)
{
request_rec *r = neg->r;
- ap_file_t *map;
+ ap_file_t *map = NULL;
ap_status_t status;
char buffer[MAX_STRING_LEN];
enum header_state hstate;
static void run_rewritemap_programs(server_rec *s, ap_context_t *p)
{
rewrite_server_conf *conf;
- ap_file_t *fpin;
- ap_file_t *fpout;
- ap_file_t *fperr;
+ ap_file_t *fpin = NULL;
+ ap_file_t *fpout = NULL;
+ ap_file_t *fperr = NULL;
ap_array_header_t *rewritemaps;
rewritemap_entry *entries;
rewritemap_entry *map;
*/
static int apprentice(server_rec *s, ap_context_t *p)
{
- ap_file_t *f;
+ ap_file_t *f = NULL;
ap_status_t result;
char line[BUFSIZ + 1];
int errs = 0;
ap_context_t *child_context = cntxt;
ap_procattr_t *procattr;
ap_proc_t *procnew = NULL;
- ap_file_t *file;
+ ap_file_t *file = NULL;
ap_iol *iol;
ap_block_alarms();
{
const char *errmsg;
cmd_parms parms;
- struct stat finfo;
+ ap_file_t *finfo = NULL;
fname = ap_server_root_relative(p, fname);
if (!(strcmp(fname, ap_server_root_relative(p, RESOURCE_CONFIG_FILE))) ||
!(strcmp(fname, ap_server_root_relative(p, ACCESS_CONFIG_FILE)))) {
- if (stat(fname, &finfo) == -1)
+ if (ap_stat(&finfo, fname, ptemp) != APR_SUCCESS)
return;
}
/* don't require conf/httpd.conf if we have a -C or -c switch */
if((ap_server_pre_read_config->nelts || ap_server_post_read_config->nelts) &&
!(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) {
- if (stat(fname, &finfo) == -1)
+ if (ap_stat(&finfo, fname, ptemp) != APR_SUCCESS)
return;
}
int rc;
if (*s->error_fname == '|') {
- ap_file_t *dummy;
+ ap_file_t *dummy = NULL;
/* This starts a new process... */
rc = log_child (p, s->error_fname+1, &dummy);
}
API_EXPORT(void) ap_error_log2stderr(server_rec *s) {
- ap_file_t *errfile;
+ ap_file_t *errfile = NULL;
ap_open_stderr(&errfile, s->process->pool);
if ( s->error_log != NULL) {
void ap_log_pid(ap_context_t *p, const char *fname)
{
- ap_file_t *pid_file;
- struct stat finfo;
+ ap_file_t *pid_file = NULL;
static pid_t saved_pid = -1;
pid_t mypid;
fname = ap_server_root_relative(p, fname);
mypid = getpid();
- if (mypid != saved_pid && stat(fname, &finfo) == 0) {
+ if (mypid != saved_pid && ap_stat(&pid_file, fname, p) == 0) {
/* WINCH and HUP call this on each restart.
* Only warn on first time through for this pid.
*
API_EXPORT(piped_log *) ap_open_piped_log(ap_context_t *p, const char *program)
{
piped_log *pl;
- ap_file_t *dummy;
+ ap_file_t *dummy = NULL;
int rc;
rc = log_child(p, program, &dummy);
*/
static void accept_mutex_init(ap_context_t *p)
{
- ap_file_t *tempfile;
+ ap_file_t *tempfile = NULL;
lock_it.l_whence = SEEK_SET; /* from current point */
lock_it.l_start = 0; /* -"- */
lock_it.l_len = 0; /* until end of file */
*/
static void accept_mutex_child_init(ap_context_t *p)
{
- ap_file_t *tempfile;
+ ap_file_t *tempfile = NULL;
ap_status_t ret;
ret=ap_open(&tempfile, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE, p);
*/
static void accept_mutex_init(ap_context_t *p)
{
- ap_file_t *tempfile;
+ ap_file_t *tempfile = NULL;
ap_status_t ret;
expand_lock_fname(p);
API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **ret_cfg, ap_context_t *p, const char *name)
{
configfile_t *new_cfg;
- ap_file_t *file;
+ ap_file_t *file = NULL;
ap_status_t stat;
ap_filetype_e type;