summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamesm <jamesm>2000-11-18 05:14:39 +0000
committerjamesm <jamesm>2000-11-18 05:14:39 +0000
commit1c033ab9fb3374c33bf09a91b28bb39bf10ecd64 (patch)
tree638e2e6d89ce2157db631bc42c486cfb01e95650
parent0bd30768b73b119618216ed34ca6e7fda0de5ae2 (diff)
added ipq_errstr() to API
-rw-r--r--include/libipq/libipq.h1
-rw-r--r--libipq/libipq.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/include/libipq/libipq.h b/include/libipq/libipq.h
index 919d215..8d49cee 100644
--- a/include/libipq/libipq.h
+++ b/include/libipq/libipq.h
@@ -77,6 +77,7 @@ int ipq_set_verdict(const struct ipq_handle *h,
int ipq_ctl(const struct ipq_handle *h, int request, ...);
+char *ipq_errstr(void);
void ipq_perror(const char *s);
#endif /* _LIBIPQ_H */
diff --git a/libipq/libipq.c b/libipq/libipq.c
index 93d76f1..ef3a0cd 100644
--- a/libipq/libipq.c
+++ b/libipq/libipq.c
@@ -296,6 +296,11 @@ int ipq_ctl(const struct ipq_handle *h, int request, ...)
return 1;
}
+char *ipq_errstr(void)
+{
+ return ipq_strerror(ipq_errno);
+}
+
void ipq_perror(const char *s)
{
if (s)
@@ -303,7 +308,7 @@ void ipq_perror(const char *s)
else
fputs("ERROR", stderr);
if (ipq_errno)
- fprintf(stderr, ": %s", ipq_strerror(ipq_errno));
+ fprintf(stderr, ": %s", ipq_errstr());
if (errno)
fprintf(stderr, ": %s", strerror(errno));
fputc('\n', stderr);