tests: build fix for OpenBSD.
authorDavin McCall <davmac@davmac.org>
Wed, 28 Feb 2018 15:29:40 +0000 (15:29 +0000)
committerDavin McCall <davmac@davmac.org>
Wed, 28 Feb 2018 15:29:40 +0000 (15:29 +0000)
src/tests/test-bpsys.cc

index e02d717c897729c00d717c5e0bcb53e8a45b380c..30df33fac5f797b3246f50a474b230e279440f98 100644 (file)
@@ -2,6 +2,8 @@
 #include <utility>
 #include <algorithm>
 
+#include <cstdlib>
+
 #include "baseproc-sys.h"
 
 static std::vector<bool> usedfds = {true, true, true};
@@ -34,7 +36,7 @@ int pipe2(int fds[2], int flags)
 
 int close(int fd)
 {
-    if (fd >= usedfds.size()) abort();
+    if (size_t(fd) >= usedfds.size()) abort();
 
     usedfds[fd] = false;
     return 0;