* formatting error messages for the log.
*/
int open_policy_file(struct policy_file *pf, const char *name,
- const char *what, const struct query *q)
+ const char *what, const struct query *q, unsigned f)
{
struct stat st;
if ((pf->fp = fopen(name, "r")) == 0) {
- logmsg(q, LOG_ERR, "failed to open %s `%s': %s",
- what, name, strerror(errno));
+ if (errno != ENOENT || !(f & OPF_NOENTOK)) {
+ logmsg(q, LOG_ERR, "failed to open %s `%s': %s",
+ what, name, strerror(errno));
+ }
goto err_0;
}
struct policy_file pf;
policy_v v = DA_INIT;
- if (open_policy_file(&pf, file, "policy file", 0))
+ if (open_policy_file(&pf, file, "policy file", 0, 0))
return (-1);
while (!read_policy_file(&pf)) {
DA_PUSH(&v, pf.p);