plymouth/plymouth-close-unredirect.patch
Raymond Wooninck cd407a8cec Accepting request 178568 from home:fcrozat:branches:Base:System
- Add plymouth-close: do not try to close negative fd.
- Add plymouth-close-unredirect.patch: do not leak fd when stopping
  redirection of /dev/console (bnc#811185)
- Add plymouth-redirect-null.patch: redirect plymouth standard io
  to /dev/null (bnc#811185)
- Add plymouth-exit-code.patch: ignore exit code in ExecStartPost.
- Add plymouth-terminal-session-close.patch: do no try to close
  terminal session fd if already closed.

OBS-URL: https://build.opensuse.org/request/show/178568
OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=107
2013-06-11 20:12:23 +00:00

35 lines
1.0 KiB
Diff

From 41560df672d0aeb954874b6d0aa81849ab35ca71 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 10 Jun 2013 10:44:56 -0400
Subject: [PATCH] terminal-session: plug /dev/console fd leak
When we stop redirecting console messages, we temporarly open
/dev/console. We don't ever close it.
This commit fixes that.
---
src/libply/ply-terminal-session.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/libply/ply-terminal-session.c b/src/libply/ply-terminal-session.c
index 3d43709..e7377e9 100644
--- a/src/libply/ply-terminal-session.c
+++ b/src/libply/ply-terminal-session.c
@@ -213,8 +213,12 @@ ply_terminal_session_unredirect_console (ply_terminal_session_t *session)
assert (session->console_is_redirected);
fd = open ("/dev/console", O_RDWR | O_NOCTTY);
- if (fd >= 0)
+ if (fd >= 0) {
ioctl (fd, TIOCCONS);
+ close (fd);
+ } else {
+ ply_trace ("couldn't open /dev/console to stop redirecting it: %m");
+ }
session->console_is_redirected = false;
}
--
1.8.1.4