From 08b68f1bdc67f4950c8b9271a6200382670f1557 Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 5 Sep 2003 23:59:17 +0000 Subject: [PATCH] EPROTO -> EINVAL for BSD backwards compatibility (did I mention that BSD *sucks*?) --- dns/dns_dfd.c | 2 +- dns/dns_packet.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dns/dns_dfd.c b/dns/dns_dfd.c index b98646e..eb8aeac 100644 --- a/dns/dns_dfd.c +++ b/dns/dns_dfd.c @@ -12,7 +12,7 @@ int dns_domain_fromdot(char **out,const char *buf,unsigned int n) char ch; char *x; - errno = EPROTO; + errno = EINVAL; for (;;) { if (!n) break; diff --git a/dns/dns_packet.c b/dns/dns_packet.c index d548cb0..367e548 100644 --- a/dns/dns_packet.c +++ b/dns/dns_packet.c @@ -8,7 +8,7 @@ DNS should have used LZ77 instead of its own sophomoric compression algorithm. unsigned int dns_packet_copy(const char *buf,unsigned int len,unsigned int pos,char *out,unsigned int outlen) { while (outlen) { - if (pos >= len) { errno = EPROTO; return 0; } + if (pos >= len) { errno = EINVAL; return 0; } *out = buf[pos++]; ++out; --outlen; } @@ -28,7 +28,7 @@ unsigned int dns_packet_skipname(const char *buf,unsigned int len,unsigned int p pos += ch; } - errno = EPROTO; + errno = EINVAL; return 0; } @@ -72,6 +72,6 @@ unsigned int dns_packet_getname(const char *buf,unsigned int len,unsigned int po return pos; PROTO: - errno = EPROTO; + errno = EINVAL; return 0; }