]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
added ipq_errstr() to API
authorJames Morris <jmorris@intercode.com.au>
Sat, 18 Nov 2000 05:14:39 +0000 (05:14 +0000)
committerJames Morris <jmorris@namei.org>
Sat, 18 Nov 2000 05:14:39 +0000 (05:14 +0000)
include/libipq/libipq.h
libipq/libipq.c

index 919d2153e94708d0873ea24c4c05db0a5d97d66a..8d49cee4682a1f8fc6ebcf14643c79dc8d06a52f 100644 (file)
@@ -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 */
index 93d76f149cd7307e33ab50f89beecc733241822c..ef3a0cd11bc4a7c3d6f66ff6c570230acdee683e 100644 (file)
@@ -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);