Subject: pppd & carrier detect
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Tim Chase <tim@introl.introl.com>
List: current-users
Date: 07/10/1994 11:06:15
Hello,

I decided to try running pppd it recently and discovered that it would
not communicate with a modem that wasn't asserting CD.  Looking at the
main.c file, I noticed that the O_NDELAY flag was commented out of the
open call.

It seemed to me that it ought to be there.  The only other change
required to make it work was to turn off the O_NONBLOCK (using fcntl)
following the two calls to set_up_tty.

Was I missing something?  Was there supposed to be some way that it
would have worked if CD wasn't present?  It seems to me, since the
previously mentioned open call seems was the only place the port was
opened that it couldn't have worked.

I'd stick a real patch with my changed in this message, but I don't
have a good way to paste them into this mail message right now.  I just
stuck in a bit of code following each of the calls to set_up_tty:

     /* set line speed, flow control, etc.; clear CLOCAL kf modeo option */
     set_up_tty(fd, 0);
+    {
+    int i;
+    i = fcntl(fd, F_GETFL);
+    i &= ~O_NONBLOCK;
+    fcntl(fd, F_SETFL, i);
+    }

Also, I uncommented the flag in the open call.

Is it a Bad Thing (tm) to use the O_NDELAY open flag?


					- Tim Chase
					  tim@introl.com

------------------------------------------------------------------------------