]> source.dussan.org Git - tigervnc.git/commitdiff
Log when sd_listen_fds() fails
authorPierre Ossman <ossman@cendio.se>
Wed, 24 Jan 2024 08:41:32 +0000 (09:41 +0100)
committerPierre Ossman <ossman@cendio.se>
Wed, 24 Jan 2024 09:27:32 +0000 (10:27 +0100)
unix/x0vncserver/x0vncserver.cxx

index 100c15f9fe1e616f61944d96b326021cde5e1119..43e68d71af834a3c526587a2a4926df0aa83c4a6 100644 (file)
@@ -120,6 +120,11 @@ static void CleanupSignalHandler(int /*sig*/)
 static int createSystemdListeners(std::list<SocketListener*> *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));