summaryrefslogtreecommitdiff
path: root/src/libs6dns/s6dns_constants_error_str.c
blob: 2c6c07261e24f9c21e5e47197d76f10e55da98e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

#include <string.h>
#include <skalibs/error.h>
#include <s6-dns/s6dns-constants.h>

char const *s6dns_constants_error_str (int e)
{
  s6dns_constants_error_message_t const *p = s6dns_constants_error ;
  while ((p->num != e) && (p->num != -1)) p++ ;
  return p->num == -1 ? strerror(e) : p->string ;
}