[Top][All Lists]

[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: tz
Subject: Re: [gpsd-dev] [PATCH] Bump GPS_PATH_MAX to allow using persistent names.
Date: Thu, 24 May 2012 17:32:29 -0400

Note that this full devicename path is included in the JSON output to identify the source.

(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.

On Thu, May 24, 2012 at 5:06 PM, Marti Bolivar <address@hidden> wrote:
Signed-off-by: Marti Bolivar <address@hidden>

The current value of GPS_PATH_MAX works for /dev/ttyfoo, but is slightly too small to allow using persistent dev names. For example, an ND-100S also shows up on my machine as /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0, which requires GPS_PATH_MAX >= 82.

I'm aware of gpsd.rules, but it seems convenient not to require the use of additional udev rules.

 gps.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gps.h b/gps.h
index 6a4920c..0f4d69e 100644
--- a/gps.h
+++ b/gps.h
@@ -43,7 +43,7 @@ extern "C" {
 #define MAXTAGLEN      8       /* maximum length of sentence tag name */
 #define MAXCHANNELS    72      /* must be > 12 GPS + 12 GLONASS + 2 WAAS */
 #define GPS_PRNMAX     32      /* above this number are SBAS satellites */
-#define GPS_PATH_MAX   64      /* dev files usually have short names */
+#define GPS_PATH_MAX   128     /* dev files usually have short names */
 #define MAXUSERDEVS    4       /* max devices per user */


reply via email to

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