I heartily approve. It's hard to find block device paths which are consistent across reboots without using /dev/disk/*/*, which do tend to exceed the 2**7 byte length pretty easily.
On Sep 10, 2013 7:26 AM, "Steffen Sledz" <
address@hidden> wrote:
The former value of 128 was too little for pathnames like
/dev/serial/by-id/... often used in modern linux distributions.
The new implementation tries to respect PATH_MAX from limits.h
if defined.
Signed-off-by: Steffen Sledz <address@hidden>
---
gps.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gps.h b/gps.h
index 44c5fc8..3347a91 100644
--- a/gps.h
+++ b/gps.h
@@ -43,7 +43,11 @@ 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 128 /* dev files usually have short names */
+#ifdef PATH_MAX
+#define GPS_PATH_MAX PATH_MAX
+#else
+#define GPS_PATH_MAX 1024 /* enough for long names like /dev/serial/by-id/... */
+#endif
#define MAXUSERDEVS 4 /* max devices per user */
/*
--
1.8.1.4