vcl: Use FreeBSD specific errno value for bad fd 82/40382/1
authorTom Jones <thj@freebsd.org>
Tue, 30 Jan 2024 16:21:58 +0000 (16:21 +0000)
committerTom Jones <thj@freebsd.org>
Fri, 23 Feb 2024 10:51:40 +0000 (10:51 +0000)
Type: improvement
Change-Id: I7693f2647f65f662c9b20f77bbf7e1a530b58259
Signed-off-by: Tom Jones <thj@freebsd.org>
src/vcl/vppcom.h

index 7826076..5683cb2 100644 (file)
@@ -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 @@ typedef enum
   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,