test/connect: skip if connect isn't supported
#include "liburing.h"
+static int no_connect;
+
static int create_socket(void)
{
int fd;
@@ -175,10 +177,16 @@ static int test_connect_with_no_peer(struct io_uring *ring)
goto err;
if (code != -ECONNREFUSED) {
+ if (code == -EINVAL || code == -EBADF || code == -EOPNOTSUPP) {
+ fprintf(stdout, "No connect support, skipping\n");
+ no_connect = 1;
+ goto out;
+ }
fprintf(stderr, "connect failed with %d\n", code);
goto err;
}
+out:
close(connect_fd);
return 0;
@@ -246,6 +254,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "test_connect_with_no_peer(): failed\n");
return 1;
}
+ if (no_connect)
+ return 0;
ret = test_connect(&ring);
if (ret == -1) {
