- initfdflags &= ~O_NONBLOCK;
- fcntl(local_fd, F_SETFL, initfdflags);
-/*
- * Read the initial line dicipline and try to put the device into the
- * PPP dicipline.
- */
- if (ioctl(local_fd, TIOCGETD, &init_disc) < 0)
- {
- syslog(LOG_ERR, "ioctl(TIOCGETD): %m(%d)", errno);
- close (local_fd);
- return 0;
- }
-
- if (ioctl(local_fd, TIOCSETD, &ppp_disc) < 0)
- {
- syslog(LOG_ERR, "ioctl(TIOCSETD): %m(%d)", errno);
- close (local_fd);
- return 0;
- }
-
- if (ioctl(local_fd, TIOCSETD, &init_disc) < 0)
- {
- syslog(LOG_ERR, "ioctl(TIOCSETD): %m(%d)", errno);
- close (local_fd);
- return 0;
- }
+ /*
+ * Try to put the device into the PPP discipline.
+ */
+ if (ioctl(local_fd, TIOCSETD, &ppp_disc) < 0) {
+ error("ioctl(TIOCSETD(PPP)): %m(%d)", errno);
+ } else
+ ret = 1;