From: Pierre Ossman Date: Wed, 24 Jan 2024 08:41:32 +0000 (+0100) Subject: Log when sd_listen_fds() fails X-Git-Tag: v1.13.90~29^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=52f438811027ed49c9aff016ac3c41c9ac3dec52;p=tigervnc.git Log when sd_listen_fds() fails --- diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 100c15f9..43e68d71 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -120,6 +120,11 @@ static void CleanupSignalHandler(int /*sig*/) static int createSystemdListeners(std::list *listeners) { int count = sd_listen_fds(0); + if (count < 0) { + vlog.error("Error getting listening sockets from systemd: %s", + strerror(-count)); + return count; + } for (int i = 0; i < count; ++i) listeners->push_back(new TcpListener(SD_LISTEN_FDS_START + i));