]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply terminal session: Drop function ply_terminal_session_execute and
authorZhaoQiang <zhaoqiangx@gmail.com>
Mon, 15 Jul 2019 10:14:06 +0000 (10:14 +0000)
committerRay Strode <halfline@gmail.com>
Mon, 15 Jul 2019 10:14:06 +0000 (10:14 +0000)
ply_terminal_session_open_console, Since this is a feature from a bygone
time which is no longer in use without ply_terminal_session_run.

src/libply/ply-terminal-session.c

index 50193328924c5534bf49e4eb3e560590679c892a..c139349fae873ae1ed30166a749201b21e98222e 100644 (file)
@@ -59,67 +59,9 @@ struct _ply_terminal_session
         uint32_t                              created_terminal_device : 1;
 };
 
-static bool ply_terminal_session_open_console (ply_terminal_session_t *session);
-static bool ply_terminal_session_execute (ply_terminal_session_t *session,
-                                          bool                    look_in_path);
 static void ply_terminal_session_start_logging (ply_terminal_session_t *session);
 static void ply_terminal_session_stop_logging (ply_terminal_session_t *session);
 
-static bool
-ply_terminal_session_open_console (ply_terminal_session_t *session)
-{
-        int fd;
-        const char *terminal_name;
-
-        terminal_name = ptsname (session->pseudoterminal_master_fd);
-
-        fd = open (terminal_name, O_RDONLY);
-
-        if (fd < 0)
-                return false;
-
-        assert (fd == STDIN_FILENO);
-        assert (ttyname (fd) != NULL);
-        assert (strcmp (ttyname (fd), terminal_name) == 0);
-
-        fd = open (terminal_name, O_WRONLY);
-
-        if (fd < 0)
-                return false;
-
-        assert (fd == STDOUT_FILENO);
-        assert (ttyname (fd) != NULL);
-        assert (strcmp (ttyname (fd), terminal_name) == 0);
-
-        fd = open (terminal_name, O_WRONLY);
-
-        if (fd < 0)
-                return false;
-
-        assert (fd == STDERR_FILENO);
-        assert (ttyname (fd) != NULL);
-        assert (strcmp (ttyname (fd), terminal_name) == 0);
-
-        return true;
-}
-
-static bool
-ply_terminal_session_execute (ply_terminal_session_t *session,
-                              bool                    look_in_path)
-{
-        ply_close_all_fds ();
-
-        if (!ply_terminal_session_open_console (session))
-                return false;
-
-        if (look_in_path)
-                execvp (session->argv[0], session->argv);
-        else
-                execv (session->argv[0], session->argv);
-
-        return false;
-}
-
 ply_terminal_session_t *
 ply_terminal_session_new (const char *const *argv)
 {