summaryrefslogtreecommitdiff
path: root/sysutils/gnome-vfs/patches/patch-ac
blob: 5bee6d30607e6a3dd24061c9df992b06cfb6d9cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$NetBSD: patch-ac,v 1.1.1.1 2000/11/25 13:57:10 rh Exp $

--- modules/file-method.c.orig	Thu Nov 16 07:57:37 2000
+++ modules/file-method.c
@@ -37,6 +37,7 @@
 #include <malloc.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <utime.h>
@@ -723,9 +724,15 @@
 		filter_needs = GNOME_VFS_DIRECTORY_FILTER_NEEDS_NOTHING;
 	}
 
+#if (defined(BSD) && BSD >= 199306)
+	if ((result = readdir (handle->dir)) != NULL) {
+		*handle->current_entry = *result;
+	}
+#else
 	if (readdir_r (handle->dir, handle->current_entry, &result) != 0) {
 		return gnome_vfs_result_from_errno ();
 	}
+#endif
 	
 	if (result == NULL) {
 		return GNOME_VFS_ERROR_EOF;
@@ -1054,9 +1061,15 @@
 
 	item_buffer = g_malloc (sizeof (struct dirent) + GET_PATH_MAX() + 1);
 	for (;;) {
+#if (defined(BSD) && BSD >= 199306)
+		if ((item = readdir (directory)) != NULL) {
+			*item_buffer = *item;
+		}
+#else
 		if (readdir_r (directory, item_buffer, &item) != 0 || item == NULL) {
 			break;
 		}
+#endif
 
 		if (gnome_vfs_context_check_cancellation (context))
 			break;