summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorTimo Juhani Lindfors <timo.lindfors@iki.fi>2010-11-06 11:55:31 -0400
committerJon Schlueter <jon.schlueter@gmail.com>2010-11-06 11:59:03 -0400
commit89ae806bad05a685c502d638da192d3b57043e22 (patch)
tree9baf38c0ce33e3359ce22fbedccf6577920e0623 /serial.c
parentec49c35087b480dcd42690de77fb7a15a4583a82 (diff)
downloadgpsd-89ae806bad05a685c502d638da192d3b57043e22.tar.gz
Bug #17637: /dev/ttySAC1 is always opened in read-only mode
More info: 1) /dev/ttySAC1 is a serial port used on samsung s3c2440 (e.g. openmoko freerunner): $ stat /dev/ttySAC1 File: `/dev/ttySAC1' Size: 0 Blocks: 0 IO Block: 4096 character special file Device: ch/12d Inode: 161 Links: 1 Device type: cc,41 Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 20/ dialout) Access: 2010-10-19 01:23:13.893489000 +0300 Modify: 2010-10-18 20:21:22.089934000 +0300 Change: 2010-10-18 20:21:22.089934000 +0300 2) I think the problem is in gpsd_classify(). It assumes that all serial ports have major number of 4. It even links to ftp://ftp.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt as a reference. However, that file nowadays lists also 204 char Low-density serial ports 0 = /dev/ttyLU0 LinkUp Systems L72xx UART - port 0 1 = /dev/ttyLU1 LinkUp Systems L72xx UART - port 1 2 = /dev/ttyLU2 LinkUp Systems L72xx UART - port 2 3 = /dev/ttyLU3 LinkUp Systems L72xx UART - port 3 4 = /dev/ttyFB0 Intel Footbridge (ARM) 5 = /dev/ttySA0 StrongARM builtin serial port 0 6 = /dev/ttySA1 StrongARM builtin serial port 1 ... The patch adds 204 to the list of recognized major numbers. Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/serial.c b/serial.c
index ec37836a..28c6befc 100644
--- a/serial.c
+++ b/serial.c
@@ -59,7 +59,7 @@ static sourcetype_t gpsd_classify(const char *path)
* ftp://ftp.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt
*/
int devmajor = major(sb.st_rdev);
- if (devmajor == 4)
+ if (devmajor == 4 || devmajor == 204)
devtype = source_rs232;
else if (devmajor == 188)
devtype = source_usb;