Skip to content

Commit

Permalink
logger.c was failing to properly log local0-local6 facilities, due to…
Browse files Browse the repository at this point in the history
… a string parsing error. This patch enables proper local facility handling.
  • Loading branch information
csarra authored and landley committed Sep 9, 2020
1 parent a7fe8d5 commit 6dedeb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions toys/posix/logger.c
Expand Up @@ -64,9 +64,10 @@ void logger_main(void)
else {
*s1++ = len = 0;
facility = arrayfind(TT.p, facilities, ARRAY_LEN(facilities));
if (facility == -1 && strncasecmp(TT.p, "local", 5)) {
facility = s1[5]-'0';
if (facility>7 || s1[6]) facility = -1;
if (facility == -1 && strncasecmp(TT.p, "local", 5) == 0) {
s2 = TT.p;
facility = s2[5]-'0';
if (facility>7 || s2[6]) facility = -1;
if (facility>=0) facility += 16;
}
if (facility<0) error_exit("bad facility: %s", TT.p);
Expand Down

0 comments on commit 6dedeb7

Please sign in to comment.