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

Function exists_and_readable

modules/ssl/ssl_engine_pphrase.c:61–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 */
60
61static apr_status_t exists_and_readable(const char *fname, apr_pool_t *pool,
62 apr_time_t *mtime)
63{
64 apr_status_t stat;
65 apr_finfo_t sbuf;
66 apr_file_t *fd;
67
68 if ((stat = apr_stat(&sbuf, fname, APR_FINFO_MIN, pool)) != APR_SUCCESS)
69 return stat;
70
71 if (sbuf.filetype != APR_REG)
72 return APR_EGENERAL;
73
74 if ((stat = apr_file_open(&fd, fname, APR_READ, 0, pool)) != APR_SUCCESS)
75 return stat;
76
77 if (mtime) {
78 *mtime = sbuf.mtime;
79 }
80
81 apr_file_close(fd);
82 return APR_SUCCESS;
83}
84
85/*
86 * reuse vhost keys for asn1 tables where keys are allocated out

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected