mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
Quiesce two warnings:
1. define the CODE * as const 2. restructure function to eliminate warning about exiting with no return. severity_map() never returns when it can't find an appropriate sysylog facility, and it longjmp()'s away into error code handling. Keep this behavior by stashing the facility value found during our search and checking for -1 if found.
This commit is contained in:
parent
9916ceb2d6
commit
bbaadbd796
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257404
|
@ -443,16 +443,21 @@ struct request_info *request;
|
|||
/* severity_map - lookup facility or severity value */
|
||||
|
||||
static int severity_map(table, name)
|
||||
CODE *table;
|
||||
const CODE *table;
|
||||
char *name;
|
||||
{
|
||||
CODE *t;
|
||||
const CODE *t;
|
||||
int ret = -1;
|
||||
|
||||
for (t = table; t->c_name; t++)
|
||||
if (STR_EQ(t->c_name, name))
|
||||
return (t->c_val);
|
||||
tcpd_jump("bad syslog facility or severity: \"%s\"", name);
|
||||
/* NOTREACHED */
|
||||
if (STR_EQ(t->c_name, name)) {
|
||||
ret = t->c_val;
|
||||
break;
|
||||
}
|
||||
if (ret == -1)
|
||||
tcpd_jump("bad syslog facility or severity: \"%s\"", name);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* severity_option - change logging severity for this event (Dave Mitchell) */
|
||||
|
|
Loading…
Reference in a new issue