Merge pull request #33325 from poettering/vsock-ret-optional

socket-util: make return parameter for socket_address_parse_vsock() o…
This commit is contained in:
Luca Boccassi
2024-06-15 00:45:28 +01:00
committed by GitHub
2 changed files with 8 additions and 3 deletions
+6
View File
@@ -26,6 +26,7 @@
#include "process-util.h"
#include "service-util.h"
#include "signal-util.h"
#include "socket-util.h"
#include "special.h"
static Manager* manager_unref(Manager *m);
@@ -143,6 +144,11 @@ static int manager_add_host_machine(Manager *m) {
t->leader = TAKE_PIDREF(pidref);
t->id = mid;
/* If vsock is available, let's expose the loopback CID for the local host (and not the actual local
* CID, in order to return a ideally constant record for the host) */
if (vsock_get_local_cid(/* ret= */ NULL) >= 0)
t->vsock_cid = VMADDR_CID_LOCAL;
t->root_directory = TAKE_PTR(rd);
t->unit = TAKE_PTR(unit);