$NetBSD: patch-ad,v 1.5 2014/06/15 22:44:15 tron Exp $

Fix build under DragonFly.

--- src/utils/directory.cc.orig	2014-04-21 14:34:45.000000000 +0100
+++ src/utils/directory.cc	2014-06-15 21:07:36.000000000 +0100
@@ -44,6 +44,10 @@
 #include <rak/path.h>
 #include <torrent/exceptions.h>
 
+#ifdef __DragonFly__
+#define d_reclen d_namlen
+#endif
+
 #include "directory.h"
 
 namespace utils {
@@ -54,7 +58,9 @@
   if (m_path.empty())
     return false;
 
-  DIR* d = opendir(rak::path_expand(m_path).c_str());
+  std::string path=rak::path_expand(m_path);
+
+  DIR* d = opendir(path.c_str());
   closedir(d);
 
   return d;
@@ -65,7 +71,9 @@
   if (m_path.empty())
     throw torrent::input_error("Directory::update() tried to open an empty path.");
 
-  DIR* d = opendir(rak::path_expand(m_path).c_str());
+  std::string path=rak::path_expand(m_path);
+
+  DIR* d = opendir(path.c_str());
 
   if (d == NULL)
     return false;
