]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machine: add debugging info to trace #35115
authorIvan Kruglov <mail@ikruglov.com>
Fri, 20 Dec 2024 15:16:56 +0000 (16:16 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 23 Dec 2024 16:38:22 +0000 (16:38 +0000)
src/machine/machine.c

index 587c2267b6929e542c131208ad6d125b0cd8f75d..7f5f48bd9b156640b053487e6746271a3253a2f1 100644 (file)
@@ -804,8 +804,10 @@ int machine_start_shell(
         /* First try to get an fd for the PTY peer via the new racefree ioctl(), directly. Otherwise go via
          * joining the namespace, because it goes by path */
         pty_fd = pty_open_peer_racefree(ptmx_fd, O_RDWR|O_NOCTTY|O_CLOEXEC);
-        if (ERRNO_IS_NEG_NOT_SUPPORTED(pty_fd))
+        if (ERRNO_IS_NEG_NOT_SUPPORTED(pty_fd)) {
+                log_debug_errno(pty_fd, "Failed to get PTY peer via racefree ioctl() (ptmx_fd=%d). Trying via joining the namespace (ptmx_name=%s): %m", ptmx_fd, ptmx_name);
                 pty_fd = machine_open_terminal(m, ptmx_name, O_RDWR|O_NOCTTY|O_CLOEXEC);
+        }
         if (pty_fd < 0)
                 return log_debug_errno(pty_fd, "Failed to open terminal: %m");