git: b64ba2426441 - main - bhyvectl: correct socket_fd closing in send_message

From: Corvin Köhne <corvink_at_FreeBSD.org>
Date: Mon, 06 Mar 2023 13:05:25 UTC
The branch main has been updated by corvink:

URL: https://cgit.FreeBSD.org/src/commit/?id=b64ba2426441ed33120ef0d3057417b7c0be6972

commit b64ba2426441ed33120ef0d3057417b7c0be6972
Author:     Vitaliy Gusev <gusev.vitaliy@gmail.com>
AuthorDate: 2023-03-06 11:30:44 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-03-06 13:03:54 +0000

    bhyvectl: correct socket_fd closing in send_message
    
    Reviewed by:            corvink, markj
    MFC after:              1 week
    Sponsored by:           vStack
    Differential Revision:  https://reviews.freebsd.org/D38889
---
 usr.sbin/bhyvectl/bhyvectl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
index 5efccc085119..59ecbebdfeae 100644
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -1707,7 +1707,7 @@ send_message(const char *vmname, nvlist_t *nvl)
 	nvlist_destroy(nvl);
 
 done:
-	if (socket_fd > 0)
+	if (socket_fd >= 0)
 		close(socket_fd);
 	return (err);
 }