SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,43 @@
Adjust the serial code for *BSD
--- src/serial.c.orig Mon Nov 14 22:03:40 2011
+++ src/serial.c Tue Nov 15 11:45:59 2011
@@ -134,7 +134,19 @@ serial_init()
ttyp = -1;
if (useTerminal)
{
-#if defined(IRIX)
+#if defined(CSRG_BASED)
+ int tty_m, tty_s;
+ if (openpty(&tty_m, &tty_s, tty_dev_name, NULL, NULL) == 0)
+ {
+ if (verbose)
+ printf("%s: wire connection on %s\n", progname, tty_dev_name);
+ wire_fd = tty_m;
+ ttyp = tty_s;
+ wire_name = strdup(tty_dev_name);
+ }
+ else
+ perror("openpty");
+#elif defined(IRIX)
if ((p = _getpty(&wire_fd, O_RDWR | O_EXCL | O_NDELAY, 0666, 0)) == NULL)
{
wire_fd = -1;
@@ -416,6 +428,8 @@ int baud;
fprintf(stderr, "%s: can\'t set baud rate, using 9600\n", progname);
ttybuf.c_cflag |= B9600;
}
+#elif defined(CSRG_BASED)
+ cfsetspeed(&ttybuf, baud);
#else
ttybuf.c_cflag &= ~CBAUD;
@@ -497,6 +511,8 @@ int baud;
}
#if defined(__APPLE__)
+#elif defined(CSRG_BASED)
+ cfsetspeed(&ttybuf, baud);
#else
ttybuf.c_cflag &= ~CBAUD;