raw-identify: use fallback if PATH_MAX not available
authorPino Toscano <toscano.pino@tiscali.it>
Sun, 1 Nov 2020 10:07:23 +0000 (11:07 +0100)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 21 Oct 2023 22:45:40 +0000 (22:45 +0000)
PATH_MAX is optional in POSIX, so define a fallback value if not
available. While ideally it should not be relied upon, a fallback value
is enough for a sample application.

Gbp-Pq: Name 0002-raw-identify-use-fallback-if-PATH_MAX-not-available.patch

samples/raw-identify.cpp

index ced51817538bd56650e5de45122d2eb68a83d00f..31c770d3417d3eb78b2d4c0b13df158be3c16c3e 100644 (file)
@@ -40,7 +40,11 @@ it under the terms of the one of two licenses as you choose:
 #include <sys/mman.h>
 #include <sys/time.h>
 #ifndef MAX_PATH
+#ifdef PATH_MAX
 #define MAX_PATH PATH_MAX
+#else
+#define MAX_PATH 4096
+#endif
 #endif
 #endif