Subject: Re: dialin/dialout crapola
To: None <tech-kern@NetBSD.ORG>
From: Charles M. Hannum <mycroft@mit.edu>
List: tech-kern
Date: 03/21/1998 06:03:50
Oops.  There were two thinkos here:

> lock file   start:			    start:
> 	      fd = open("/dev/ttyXXX", 0);  if (!create_lock_file())
> 	      if (!create_lock_file())	      sleep(N), goto start;
> 	        sleep(N), goto start;	    fd = open("/dev/ttyXXX", O_NONBLOCK);

For dialout, we just fail rather than retrying the lock.

>    * For the ISOPEN method, if the open was blocking and ISOPEN is
>      set, we wait.  (This is trivial to do in the same loop that
>      already waits for carrier.)

This doesn't actually work; it breaks the semantics that a session on
a dialin line must be able to reopen the the port as many times as it
wants.  There would have to be an additional state bit indicating
whether we thought the device was open for dialout use.  (This bit
could also be used elsewhere.)