| 435 | static rte_thread_t reconn_tid; |
| 436 | |
| 437 | static int |
| 438 | vhost_user_connect_nonblock(char *path, int fd, struct sockaddr *un, size_t sz) |
| 439 | { |
| 440 | int ret, flags; |
| 441 | |
| 442 | ret = connect(fd, un, sz); |
| 443 | if (ret < 0 && errno != EISCONN) |
| 444 | return -1; |
| 445 | |
| 446 | flags = fcntl(fd, F_GETFL, 0); |
| 447 | if (flags < 0) { |
| 448 | VHOST_LOG_CONFIG(path, ERR, "can't get flags for connfd %d (%s)\n", |
| 449 | fd, strerror(errno)); |
| 450 | return -2; |
| 451 | } |
| 452 | if ((flags & O_NONBLOCK) && fcntl(fd, F_SETFL, flags & ~O_NONBLOCK)) { |
| 453 | VHOST_LOG_CONFIG(path, ERR, "can't disable nonblocking on fd %d\n", fd); |
| 454 | return -2; |
| 455 | } |
| 456 | return 0; |
| 457 | } |
| 458 | |
| 459 | static uint32_t |
| 460 | vhost_user_client_reconnect(void *arg __rte_unused) |
no test coverage detected