* OR MODIFICATIONS.
*/
-#ifndef lint
-static char rcsid[] = "$Id: sys-sunos4.c,v 1.19 1999/04/01 07:20:11 paulus Exp $";
-#endif
+#define RCSID "$Id: sys-sunos4.c,v 1.25 1999/12/23 01:38:19 paulus Exp $"
#include <stdio.h>
#include <stddef.h>
#endif
#endif /*sparc*/
+static const char rcsid[] = RCSID;
+
static int pppfd;
static int fdmuxid = -1;
static int iffd;
return 1;
}
-
+#if 0
/*
* daemon - Detach us from controlling terminal session.
*/
}
return 0;
}
+#endif
/*
* ppp_available - check whether the system has any ppp interfaces
int t;
t = timo == NULL? -1: timo->tv_sec * 1000 + timo->tv_usec / 1000;
- if (poll(pollfds, n_pollfds, t) < 0 && errno != EINTR)
- fatal("poll: %m");
+ if (poll(pollfds, n_pollfds, t) < 0 && errno != EINTR) {
+ if (errno != EAGAIN)
+ fatal("poll: %m");
+ /* we can get EAGAIN on a heavily loaded system,
+ * just wait a short time and try again. */
+ usleep(50000);
+ }
}
/*
flags = 0;
len = getmsg(pppfd, &ctrl, &data, &flags);
if (len < 0) {
- if (errno = EAGAIN || errno == EINTR)
+ if (errno == EAGAIN || errno == EINTR)
return -1;
fatal("Error reading packet: %m");
}
if ((fd = open(WTMPFILE, O_WRONLY|O_APPEND, 0)) < 0)
return;
if (!fstat(fd, &buf)) {
- strlcpy(ut.ut_line, line, sizeof(ut.ut_line));
- strlcpy(ut.ut_name, name, sizeof(ut.ut_name));
- strlcpy(ut.ut_host, host, sizeof(ut.ut_host));
+ strncpy(ut.ut_line, line, sizeof(ut.ut_line));
+ strncpy(ut.ut_name, name, sizeof(ut.ut_name));
+ strncpy(ut.ut_host, host, sizeof(ut.ut_host));
(void)time(&ut.ut_time);
if (write(fd, (char *)&ut, sizeof(struct utmp)) != sizeof(struct utmp))
(void)ftruncate(fd, buf.st_size);
return gethostid();
}
+#if 0
/*
* Code for locking/unlocking the serial device.
* This code is derived from chat.c.
lock_file = NULL;
}
}
+#endif /* lock stuff removed */
/*
* get_pty - get a pty master/slave pair and chown the slave side