summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2007-03-09 07:23:36 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2007-03-09 07:23:36 +0000
commitbbce51c656ee078feb5a2a620633857c00a427ce (patch)
treed203ce170999c9f7b52600ee41a7d0a72cc029d4 /serial.c
parent12cc87ebee8f86caccdadc63e8153d32d3341405 (diff)
downloadgpsd-bbce51c656ee078feb5a2a620633857c00a427ce.tar.gz
committed from the wrong tree, so fix the "-b" flag.
now it really does work "like it says on the tin."
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/serial.c b/serial.c
index acd9a5ca..d4bec0c6 100644
--- a/serial.c
+++ b/serial.c
@@ -201,13 +201,13 @@ void gpsd_set_speed(struct gps_device_t *session,
int gpsd_open(struct gps_device_t *session)
{
struct stat sb;
- mode_t mode = O_RDONLY;
+ mode_t mode = O_RDWR;
if (readonly || ((stat(session->gpsdata.gps_device, &sb) != -1) && ((sb.st_mode & S_IFCHR) == S_IFCHR))){
- mode = O_RDWR;
- gpsd_report(LOG_INF, "opening GPS data source at '%s'\n", session->gpsdata.gps_device);
- } else {
+ mode = O_RDONLY;
gpsd_report(LOG_INF, "opening read-only GPS data source at '%s'\n", session->gpsdata.gps_device);
+ } else {
+ gpsd_report(LOG_INF, "opening GPS data source at '%s'\n", session->gpsdata.gps_device);
}
if ((session->gpsdata.gps_fd = open(session->gpsdata.gps_device, mode|O_NONBLOCK|O_NOCTTY)) < 0) {