vcl: Use FreeBSD specific errno value for bad fd
Type: improvement
Change-Id: I7693f2647f65f662c9b20f77bbf7e1a530b58259
Signed-off-by: Tom Jones <thj@freebsd.org>
diff --git a/src/vcl/vppcom.h b/src/vcl/vppcom.h
index 7826076..5683cb2 100644
--- a/src/vcl/vppcom.h
+++ b/src/vcl/vppcom.h
@@ -16,6 +16,9 @@
#ifndef included_vppcom_h
#define included_vppcom_h
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif /* __FreeBSD__ */
#include <netdb.h>
#include <errno.h>
#include <fcntl.h>
@@ -116,7 +119,11 @@
VPPCOM_EFAULT = -EFAULT,
VPPCOM_ENOMEM = -ENOMEM,
VPPCOM_EINVAL = -EINVAL,
+#ifdef __linux__
VPPCOM_EBADFD = -EBADFD,
+#else
+ VPPCOM_EBADFD = -EBADF,
+#endif /* __linux__ */
VPPCOM_EAFNOSUPPORT = -EAFNOSUPPORT,
VPPCOM_ECONNABORTED = -ECONNABORTED,
VPPCOM_ECONNRESET = -ECONNRESET,