From: Zhao Qiang Date: Fri, 6 Mar 2020 17:43:03 +0000 (+0800) Subject: terminal-session: Drop unnecessary grantpt() call. X-Git-Tag: 0.9.5~18^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7987d192700f3df591f0169eed4f349a9c2fd7f;p=thirdparty%2Fplymouth.git terminal-session: Drop unnecessary grantpt() call. plymouth calls `grantpt()` when setting up the pseudoterminal it uses for boot logging and console broadcasting. `grantpt()` traditionally sets up the access permissions and file mode of the created slave pseudoterminal device node. That call is unnecessary for two reasons: 1. The kernel automatically sets up the correct permissions at open time on modern Linux. 2. plymouthd runs as root anyway Furthermore, it seems like, for some unknown reason, the call may be interfering with the shutdown process. This commit drops the call, since it's unnecessary, and potentially even problematic. --- diff --git a/src/libply/ply-terminal-session.c b/src/libply/ply-terminal-session.c index c139349f..cacd3650 100644 --- a/src/libply/ply-terminal-session.c +++ b/src/libply/ply-terminal-session.c @@ -183,16 +183,6 @@ open_pseudoterminal (ply_terminal_session_t *session) ply_trace (" opened device '/dev/ptmx'"); - ply_trace ("creating pseudoterminal"); - if (grantpt (session->pseudoterminal_master_fd) < 0) { - ply_save_errno (); - ply_trace ("could not create psuedoterminal: %m"); - close_pseudoterminal (session); - ply_restore_errno (); - return false; - } - ply_trace ("done creating pseudoterminal"); - ply_trace ("unlocking pseudoterminal"); if (unlockpt (session->pseudoterminal_master_fd) < 0) { ply_save_errno ();