gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] massive regression failures


From: Greg Troxel
Subject: Re: [gpsd-dev] massive regression failures
Date: Fri, 23 Jan 2015 10:48:28 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.4 (berkeley-unix)

"Eric S. Raymond" <address@hidden> writes:

> And, right after it, write the equivalent and properly conditionalized test
> for NetBSD.  I tried to google a list of NetBSD device numbers so I could
> do this myself, but didn't find one.

You didn't find that, I think, partly because device major numbers are
different per architecture, and partly because names in /dev are
supposed to be an abstraction.  And even the linux case statement is
pretty icky with magic numbers from someplace.  Are you sure those don't
change across architectures?  At least long ago it seemed even types in
headers did.

I'll see if there's some way to deal with this.

But in the meantime, it seems that the default assumption before the
ifdef linux should be something that results in safe beahvior.  I'm
doing a test run with the default at sourcetype_unknown, which feels
more correct than assuming a character device we don't know about is
rs232 (by which you presumably mean "acts like a real serial
port/UART").  However, tests fail, probably because the adaptive delay
is done for !pty, rather than specific types that need it.

With this, tests seem to be running ok so far:

From 6b757b1fbcde3c42cfc0bcf676535623a5d10a6a Mon Sep 17 00:00:00 2001
From: Greg Troxel <address@hidden>
Date: Fri, 23 Jan 2015 10:41:27 -0500
Subject: [PATCH] add hacky check for pty

---
 serial.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/serial.c b/serial.c
index 66107f7..d4a02c2 100644
--- a/serial.c
+++ b/serial.c
@@ -64,6 +64,19 @@ static sourcetype_t gpsd_classify(const char *path)
        else if (devmajor == 3 || (devmajor >= 136 && devmajor <= 143))
            devtype = source_pty;
 #endif /* __linux__ */
+#ifdef __NetBSD__
+       /*
+        * Hacky check for pty, which is what really matters for avoiding
+        * adaptive delay.
+        */
+       if (strncmp(path, "/dev/ttyp", 9) == 0 ||
+           strncmp(path, "/dev/ttyq", 9) == 0)
+           devtype = source_pty;
+       else if (strncmp(path, "/dev/ttyU", 9) == 0 ||
+           strncmp(path, "/dev/dtyU", 9) == 0)
+           devtype = source_usb;
+       /* XXX bluetooth */
+#endif /* __NetBSD__ */
        return devtype;
     } else
        return source_unknown;
-- 
2.2.1

Attachment: pgpmOpsl8nHEW.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]