Add a hackaround to allow gpsdrive to use serial devices on FreeBSD. The

original code is a non-portable Linuxism; this patch changes it to a non-
portable FreeBSDism.  A more elaborate and portable patch will be submitted
to the author.

Approved by:	portmgr (krion), maintainer
This commit is contained in:
Dag-Erling Smørgrav 2004-09-07 10:38:47 +00:00
parent 66eb802bc3
commit f8df20da12
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=118132
2 changed files with 14 additions and 0 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= gpsdrive
PORTVERSION= 2.09
PORTREVISION= 1
CATEGORIES= astro
MASTER_SITES= http://www.gpsdrive.cc/ \
http://www.gpsdrive.oc512.us/ \

View file

@ -0,0 +1,13 @@
--- src/gpsserial.c.orig Thu Feb 12 18:42:53 2004
+++ src/gpsserial.c Mon Sep 6 00:44:34 2004
@@ -178,7 +178,9 @@
CLOCAL : local connection, no modem contol
CREAD : enable receiving characters
*/
- newtio.c_cflag = (11 + serialspeed) | CS8 | CLOCAL | CREAD;
+ int t[] = { 2400, 4800, 9600, 19200, 38400 };
+ newtio.c_ispeed = newtio.c_ospeed = t[serialspeed];
+ newtio.c_cflag = CS8 | CLOCAL | CREAD;
newtio.c_cflag &= ~(PARENB | CRTSCTS);
/*
IGNPAR : ignore bytes with parity errors