*/
#ifndef lint
-static char rcsid[] = "$Id: sys-str.c,v 1.18 1995/04/27 00:35:43 paulus Exp $";
+static char rcsid[] = "$Id: sys-str.c,v 1.21 1995/06/12 12:18:04 paulus Exp $";
#endif
/*
restore_tty()
{
if (restore_term) {
+ if (!default_device) {
+ /*
+ * Turn off echoing, because otherwise we can get into
+ * a loop with the tty and the modem echoing to each other.
+ * We presume we are the sole user of this tty device, so
+ * when we close it, it will revert to its defaults anyway.
+ */
+ inittermios.c_lflag &= ~(ECHO | ECHONL);
+ }
if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0)
if (errno != ENXIO)
syslog(LOG_WARNING, "tcsetattr: %m");
* network as `addr'. If we find any, we OR in their netmask to the
* user-specified netmask.
*/
+#define MAX_IFS 32
+
u_int32_t
GetMask(addr)
u_int32_t addr;
return mask;
}
ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
- for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *)
- ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) {
+ for (ifr = ifc.ifc_req; ifr < ifend; ++ifr) {
/*
* Check the interface's internet address.
*/
lock_file = NULL;
}
}
+
+/*
+ * SunOS doesn't have strtoul :-(
+ */
+unsigned long
+strtoul(str, ptr, base)
+ char *str, **ptr;
+ int base;
+{
+ return (unsigned long) strtol(str, ptr, base);
+}