git-svn: trunk@1034
Nigel Horne authored on 2004/10/21 19:18:40... | ... |
@@ -17,6 +17,9 @@ |
17 | 17 |
* |
18 | 18 |
* Change History: |
19 | 19 |
* $Log: mbox.c,v $ |
20 |
+ * Revision 1.161 2004/10/21 10:18:40 nigelhorne |
|
21 |
+ * PARTIAL: readdir_r even more options :-( |
|
22 |
+ * |
|
20 | 23 |
* Revision 1.160 2004/10/21 09:41:07 nigelhorne |
21 | 24 |
* PARTIAL: add readdir_r fix to BeOS |
22 | 25 |
* |
... | ... |
@@ -468,7 +471,7 @@ |
468 | 468 |
* Compilable under SCO; removed duplicate code with message.c |
469 | 469 |
* |
470 | 470 |
*/ |
471 |
-static char const rcsid[] = "$Id: mbox.c,v 1.160 2004/10/21 09:41:07 nigelhorne Exp $"; |
|
471 |
+static char const rcsid[] = "$Id: mbox.c,v 1.161 2004/10/21 10:18:40 nigelhorne Exp $"; |
|
472 | 472 |
|
473 | 473 |
#if HAVE_CONFIG_H |
474 | 474 |
#include "clamav-config.h" |
... | ... |
@@ -2812,10 +2815,21 @@ rfc1341(message *m, const char *dir) |
2812 | 2812 |
|
2813 | 2813 |
snprintf(filename, sizeof(filename), "%s%d", id, n); |
2814 | 2814 |
#ifdef HAVE_READDIR_R_3 |
2815 |
+#if defined(C_SOLARIS) || defined(C_BEOS) |
|
2816 |
+ while((readdir_r(dd, (struct dirent *)result, &dent) == 0) && dent) { |
|
2817 |
+#else |
|
2815 | 2818 |
while((readdir_r(dd, (struct dirent *)&result, &dent) == 0) && dent) { |
2819 |
+#endif |
|
2820 |
+ |
|
2816 | 2821 |
#elif defined(HAVE_READDIR_R_2) |
2822 |
+ |
|
2823 |
+#if defined(C_SOLARIS) || defined(C_BEOS) |
|
2817 | 2824 |
while((dent = (struct dirent *)readdir_r(dd, (struct dirent *)&result))) { |
2818 | 2825 |
#else |
2826 |
+ while((dent = (struct dirent *)readdir_r(dd, (struct dirent *)result))) { |
|
2827 |
+#endif |
|
2828 |
+ |
|
2829 |
+#else /*!HAVE_READDIR_R*/ |
|
2819 | 2830 |
while((dent = readdir(dd))) { |
2820 | 2831 |
#endif |
2821 | 2832 |
char fullname[NAME_MAX + 1]; |