diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2007-03-09 07:23:36 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2007-03-09 07:23:36 +0000 |
commit | bbce51c656ee078feb5a2a620633857c00a427ce (patch) | |
tree | d203ce170999c9f7b52600ee41a7d0a72cc029d4 /serial.c | |
parent | 12cc87ebee8f86caccdadc63e8153d32d3341405 (diff) | |
download | gpsd-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) { |