*/
#ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.8 1994/05/01 11:44:43 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.9 1994/05/09 02:40:21 paulus Exp $";
#endif
#define SETSID
char devname[MAXPATHLEN] = "/dev/tty"; /* Device name */
int default_device = TRUE; /* use default device (stdin/out) */
-int fd; /* Device file descriptor */
+int fd = -1; /* Device file descriptor */
int s; /* Socket file descriptor */
int phase; /* where the link is at */
int fd, local;
{
#ifndef SGTTY
- int speed;
+ int speed, x;
struct termios tios;
if (tcgetattr(fd, &tios) < 0) {
die(1);
}
+#ifdef ultrix
+ x = 0;
+ if (ioctl(fd, (crtscts || modem)? TIOCMODEM: TIOCNMODEM, &x) < 0)
+ syslog(LOG_WARNING, "TIOC(N)MODEM: %m");
+ if (ioctl(fd, (local || !modem)? TIOCNCAR: TIOCCAR) < 0)
+ syslog(LOG_WARNING, "TIOC(N)CAR: %m");
+#endif
+
#else /* SGTTY */
int speed;
struct sgttyb sgttyb;
if (modem)
setdtr(fd, FALSE);
- if (fcntl(fd, F_SETFL, initfdflags) < 0)
+ if (initfdflags != -1 && fcntl(fd, F_SETFL, initfdflags) < 0)
syslog(LOG_WARNING, "fcntl(F_SETFL, fdflags): %m");
disestablish_ppp();