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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
--- mozilla-1.9.2/ipc/chromium/src/base/file_util.h
+++ mozilla-1.9.2.orig/ipc/chromium/src/base/file_util.h
@@ -13,7 +13,6 @@
#if defined(OS_WIN)
#include <windows.h>
#elif defined(OS_POSIX)
-#include <fts.h>
#include <sys/stat.h>
#endif
@@ -463,9 +462,6 @@
#if defined(OS_WIN)
WIN32_FIND_DATA find_data_;
HANDLE find_handle_;
-#elif defined(OS_POSIX)
- FTS* fts_;
- FTSENT* fts_ent_;
#endif
DISALLOW_EVIL_CONSTRUCTORS(FileEnumerator);
--- mozilla-1.9.2/ipc/chromium/src/base/file_util_posix.cc
+++ mozilla-1.9.2.orig/ipc/chromium/src/base/file_util_posix.cc
@@ -8,7 +8,6 @@
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
-#include <fts.h>
#include <libgen.h>
#include <stdio.h>
#include <string.h>
@@ -103,6 +102,7 @@
// that functionality. If not, remove from file_util_win.cc, otherwise add it
// here.
bool Delete(const FilePath& path, bool recursive) {
+#if 0
const char* path_str = path.value().c_str();
struct stat64 file_info;
int test = stat64(path_str, &file_info);
@@ -155,6 +155,9 @@
fts_close(fts);
}
return success;
+#else
+ return false;
+#endif
}
bool Move(const FilePath& from_path, const FilePath& to_path) {
@@ -171,6 +174,7 @@
bool CopyDirectory(const FilePath& from_path,
const FilePath& to_path,
bool recursive) {
+#if 0
// Some old callers of CopyDirectory want it to support wildcards.
// After some discussion, we decided to fix those callers.
// Break loudly here if anyone tries to do this.
@@ -270,6 +274,7 @@
LOG(ERROR) << "CopyDirectory(): " << strerror(error);
return false;
}
+#endif
return true;
}
@@ -506,8 +511,11 @@
FileEnumerator::FILE_TYPE file_type)
: recursive_(recursive),
file_type_(file_type),
- is_in_find_op_(false),
- fts_(NULL) {
+ is_in_find_op_(false)
+#if 0
+ ,fts_(NULL)
+#endif
+{
pending_paths_.push(root_path);
}
@@ -518,8 +526,11 @@
: recursive_(recursive),
file_type_(file_type),
pattern_(root_path.value()),
- is_in_find_op_(false),
- fts_(NULL) {
+ is_in_find_op_(false)
+#if 0
+ ,fts_(NULL)
+#endif
+{
// The Windows version of this code only matches against items in the top-most
// directory, and we're comparing fnmatch against full paths, so this is the
// easiest way to get the right pattern.
@@ -528,11 +539,14 @@
}
FileEnumerator::~FileEnumerator() {
+#if 0
if (fts_)
fts_close(fts_);
+#endif
}
void FileEnumerator::GetFindInfo(FindInfo* info) {
+#if 0
DCHECK(info);
if (!is_in_find_op_)
@@ -540,6 +554,7 @@
memcpy(&(info->stat), fts_ent_->fts_statp, sizeof(info->stat));
info->filename.assign(fts_ent_->fts_name);
+#endif
}
// As it stands, this method calls itself recursively when the next item of
@@ -547,6 +562,7 @@
// large directories with many files this can be quite deep.
// TODO(erikkay) - get rid of this recursive pattern
FilePath FileEnumerator::Next() {
+#if 0
if (!is_in_find_op_) {
if (pending_paths_.empty())
return FilePath();
@@ -600,6 +616,9 @@
}
// TODO(erikkay) - verify that the other fts_info types aren't interesting
return Next();
+#else
+ return FilePath();
+#endif
}
///////////////////////////////////////////////
|