Browse Source

Ticket #2516: Fix build failure on DragonFly BSD

DragonFly BSD doesn't provide MAXNAMLEN macro to define size of d_name
member of dirent structure. NAME_MAX is used if MAXNAMLEN is not
provided by OS.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Andrew Borodin 14 years ago
parent
commit
726d68d14f
1 changed files with 4 additions and 3 deletions
  1. 4 3
      lib/fs.h

+ 4 - 3
lib/fs.h

@@ -67,12 +67,13 @@
 #define NLENGTH(dirent) (strlen ((dirent)->d_name))
 #define DIRENT_LENGTH_COMPUTED 1
 
+/* DragonFlyBSD doesn't provide MAXNAMLEN macro */
 #ifndef MAXNAMLEN
-#define MC_MAXFILENAMELEN 256
-#else
-#define MC_MAXFILENAMELEN MAXNAMLEN
+#define MAXNAMLEN NAME_MAX
 #endif
 
+#define MC_MAXFILENAMELEN MAXNAMLEN
+
 /*** enums ***************************************************************************************/
 
 /*** structures declarations (and typedefs of structures)*****************************************/