]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: explicitly close pty forwarder before printing summary
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Dec 2016 23:34:34 +0000 (00:34 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 3 Feb 2017 10:51:57 +0000 (11:51 +0100)
If the PTY forwarder is still around our TTY will have borked settings,
regarding newlines, hence explicitly close it before showing the
summary, so that it looks pretty.

src/run/run.c

index df3b47af29e9c74c399093a0bacfd803dfbbd924..d3d491e87f5075ee38ec130497f492c4368dd204 100644 (file)
@@ -1059,6 +1059,12 @@ static int start_transient_service(
                 }
 
                 if (!arg_quiet) {
+
+                        /* Explicitly destroy the PTY forwarder, so that the PTY device is usable again, in its
+                         * original settings (i.e. proper line breaks), so that we can show the summary in a pretty
+                         * way. */
+                        c.forward = pty_forward_free(c.forward);
+
                         if (!isempty(c.result))
                                 log_info("Finished with result: %s", strna(c.result));