| 180 | } |
| 181 | |
| 182 | static int test_connect_with_no_peer(struct io_uring *ring) |
| 183 | { |
| 184 | int connect_fd; |
| 185 | int ret, code; |
| 186 | |
| 187 | connect_fd = create_socket(); |
| 188 | if (connect_fd == -1) |
| 189 | return -1; |
| 190 | |
| 191 | ret = connect_socket(ring, connect_fd, &code, 0); |
| 192 | if (ret == -1) |
| 193 | goto err; |
| 194 | |
| 195 | if (code != -ECONNREFUSED) { |
| 196 | if (code == -EINVAL || code == -EBADF || code == -EOPNOTSUPP) { |
| 197 | fprintf(stdout, "No connect support, skipping\n"); |
| 198 | no_connect = 1; |
| 199 | goto out; |
| 200 | } |
| 201 | fprintf(stderr, "connect failed with %d\n", code); |
| 202 | goto err; |
| 203 | } |
| 204 | |
| 205 | out: |
| 206 | close(connect_fd); |
| 207 | return 0; |
| 208 | |
| 209 | err: |
| 210 | close(connect_fd); |
| 211 | return -1; |
| 212 | } |
| 213 | |
| 214 | static int test_connect(struct io_uring *ring, int async) |
| 215 | { |
no test coverage detected