🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by "Marco Franzen" Sat, 17 Jun 1989 23:57
TIOCSETN without fsync in 0.83
#28
Author: "Marco Franzen"
Date: Sat, 17 Jun 1989 23:57
68 lines
2338 bytes
I don't know whether this is an error in bash or my OS.

When I do an ioctl (tty, TIOCSETN, &parms) before the output queue has
drained (on a serial line), I get garbled output. A fsync (tty) cures
this. To be sure I have added this before TIOCSETD, too.

Perhaps it should be conditional (#ifdef BSD).

*** readline.c~	Thu Dec  1 21:28:32 1988
--- readline.c	Thu Jun 15 22:41:15 1989
***************
*** 963,968
    }
    the_ttybuff.sg_flags &= ~ECHO;
    the_ttybuff.sg_flags |= (CBREAK | CRMOD);
    ioctl (tty, TIOCSETN, &the_ttybuff);
  }


--- 963,969 -----
    }
    the_ttybuff.sg_flags &= ~ECHO;
    the_ttybuff.sg_flags |= (CBREAK | CRMOD);
+   fsync (tty);
    ioctl (tty, TIOCSETN, &the_ttybuff);
  }

***************
*** 972,977
    int tty = fileno (rl_instream);

    the_ttybuff.sg_flags = original_tty_flags;
    ioctl (tty, TIOCSETN, &the_ttybuff);
  }
  #endif

--- 973,979 -----
    int tty = fileno (rl_instream);

    the_ttybuff.sg_flags = original_tty_flags;
+   fsync (tty);
    ioctl (tty, TIOCSETN, &the_ttybuff);
  }
  #endif

*** jobs.c~	Mon Nov 21 06:19:42 1988
--- jobs.c	Thu Jun 15 22:41:14 1989
***************
*** 857,862
      if (ldisc != NTTYDISC) {
        ldisc = NTTYDISC;
        err_string = "set";
        if (ioctl (shell_tty, TIOCSETD, &ldisc) < 0) {
  bad_ioctl:
  	fprintf (stderr, "initialize_jobs: %s line disc", err_string);

--- 857,863 -----
      if (ldisc != NTTYDISC) {
        ldisc = NTTYDISC;
        err_string = "set";
+       fsync (shell_tty);
        if (ioctl (shell_tty, TIOCSETD, &ldisc) < 0) {
  bad_ioctl:
  	fprintf (stderr, "initialize_jobs: %s line disc", err_string);

Marco Franzen	                           franzen@tubsibr.UUCP
Tech. U Brunswick, Germany    franzen%tubsibr.UUCP@uni-dortmund.DE
                               	           franzen@dbsinf6.BITNET
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads