Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 0dbe3f7

Browse files
committed
use local var to denote vsock capability
Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent b1d7161 commit 0dbe3f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ static int hyper_setup_init_process(void)
14981498
int main(int argc, char *argv[])
14991499
{
15001500
char *binary_name, *cmdline, *ctl_serial, *tty_serial;
1501-
bool is_init;
1501+
bool is_init, has_vsock = false;
15021502

15031503
binary_name = basename(argv[0]);
15041504
is_init = strncmp(binary_name, "init", 5) == 0;
@@ -1526,11 +1526,11 @@ int main(int argc, char *argv[])
15261526
} else if (hyper_cmd("modprobe vmw_vsock_virtio_transport") < 0) {
15271527
fprintf(stderr, "fail to load vmw_vsock_virtio_transport.ko\n");
15281528
} else {
1529-
hyper_epoll.vsock_ctl_listener.fd = 1; /* >0 indicates vsock support */
1529+
has_vsock = true;
15301530
}
15311531
#endif
15321532

1533-
if (hyper_epoll.vsock_ctl_listener.fd > 0) {
1533+
if (has_vsock) {
15341534
if (hyper_setup_vsock_channel() < 0) {
15351535
fprintf(stderr, "fail to setup hyper vsock listener\n");
15361536
goto out;

0 commit comments

Comments
 (0)