Re: ttyS1 hangs, cua1 works fine

Gert Doering (gert@greenie.muc.de)
Mon, 6 Apr 1998 09:00:55 +0200 (MEST)


Hi,

Richard B. Johnson wrote:
> /*
> * Set to dumb RAW mode with no echo and no character interpretation.
> */
> memset(&io_mod, 0x00, sizeof(io_mod)); /* bzero() is obsolete */
> io_mod.c_cflag = B38400|CS8|CREAD|CLOCAL;
> io_mod.c_iflag = IGNBRK|IGNPAR;
> io_mod.c_cc[VMIN] = (cc_t) 1;
> io_mod.c_cc[VTIME] = (cc_t) 1;

I can only strongly recommend against just "bzero()"'ing a structure that
*might* contain some flags that you don't know about.

Explicitely clear the flags that you want to have cleared, explicitely set
those that you want to be set, *KEEP* the rest unchanged.

(But now we're getting offtopic on linux-kernel, that's just a matter of
defensive programming -- if you do it your way, it *will* break on strange
systems like SCO).

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert@greenie.muc.de
fax: +49-89-35655025                        gert.doering@physik.tu-muenchen.de

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu