gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] [PATCH] Bump GPS_PATH_MAX to allow using persistent names


From: Marti Bolivar
Subject: Re: [gpsd-dev] [PATCH] Bump GPS_PATH_MAX to allow using persistent names.
Date: Thu, 24 May 2012 17:53:11 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1



On 05/24/2012 05:32 PM, tz wrote:
Note that this full devicename path is included in the JSON output to
identify the source.

I'm giving gpsd the path to use as argument, so I have to know it beforehand.

(This was discussed before, and I suggested some ordinal or the file number
returned by open or something, and I said it would bite - there can also be
duplicates, e.g. TCP or UDP connections).

There is no speciific reason to have to know or store a system defined file
path after the device node is opened, but it is being used as part of the
data.

You are changing it to 128 now, but it might need to be 256 later, e.g. the
dev path might get vary long if it models the USB device bus tree and
includes this.  There is no static limit to a full path name, so the real
alternatives are to malloc it (if you are going to store it and not just
point to argv or something) or to store something else.

I understand (and respect) the no-malloc policy, and I'm not trying to give gpsd a case of C programmer's disease. It's just confusing to first see encouraging output like this:

gpsd:INFO: stashing device /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0 at slot 0

Then get strange errors:

gpsd:INFO: opening read-only GPS data source type 0 and at '/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Contr' gpsd:ERROR: device open failed: No such file or directory - retrying read-only
gpsd:ERROR: read-only device open failed: No such file or directory
gpsd:ERROR: /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Contr: device activation failed.

I suppose the real fix is to spit out an error immediately if the user specifies a path that's longer than GPS_PATH_MAX.

Best,
Marti



reply via email to

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