]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script: rename fixtty() to enable_rawmode_tty()
authorKarel Zak <kzak@redhat.com>
Mon, 26 Jun 2017 13:30:12 +0000 (15:30 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 26 Jun 2017 13:30:12 +0000 (15:30 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/script.c

index 19e9976d92539ac97ac0b7b96aa1d17d7e4a3b36..01be3d7c51d8a3a15561e98355bbd7a1fe85bba7 100644 (file)
@@ -201,6 +201,19 @@ static void restore_tty(struct script_control *ctl, int mode)
        tcsetattr(STDIN_FILENO, mode, &rtt);
 }
 
+static void enable_rawmode_tty(struct script_control *ctl)
+{
+       struct termios rtt;
+
+       if (!ctl->isterm)
+               return;
+
+       rtt = ctl->attrs;
+       cfmakeraw(&rtt);
+       rtt.c_lflag &= ~ECHO;
+       tcsetattr(STDIN_FILENO, TCSANOW, &rtt);
+}
+
 static void __attribute__((__noreturn__)) done(struct script_control *ctl)
 {
        DBG(MISC, ul_debug("done!"));
@@ -605,18 +618,6 @@ static void __attribute__((__noreturn__)) do_shell(struct script_control *ctl)
        fail(ctl);
 }
 
-static void fixtty(struct script_control *ctl)
-{
-       struct termios rtt;
-
-       if (!ctl->isterm)
-               return;
-
-       rtt = ctl->attrs;
-       cfmakeraw(&rtt);
-       rtt.c_lflag &= ~ECHO;
-       tcsetattr(STDIN_FILENO, TCSANOW, &rtt);
-}
 
 static void getmaster(struct script_control *ctl)
 {
@@ -773,7 +774,7 @@ int main(int argc, char **argv)
        getmaster(&ctl);
        if (!ctl.quiet)
                printf(_("Script started, file is %s\n"), ctl.fname);
-       fixtty(&ctl);
+       enable_rawmode_tty(&ctl);
 
 #ifdef HAVE_LIBUTEMPTER
        utempter_add_record(ctl.master, NULL);