Lines 1-4
Link Here
|
1 |
--- base/files/file_util_posix.cc.orig 2021-07-19 18:45:05 UTC |
1 |
--- base/files/file_util_posix.cc.orig 2021-08-17 00:15:54 UTC |
2 |
+++ base/files/file_util_posix.cc |
2 |
+++ base/files/file_util_posix.cc |
3 |
@@ -23,6 +23,10 @@ |
3 |
@@ -23,6 +23,10 @@ |
4 |
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) |
4 |
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) |
Lines 79-85
Link Here
|
79 |
bool CopyFileContentsWithSendfile(File& infile, |
79 |
bool CopyFileContentsWithSendfile(File& infile, |
80 |
File& outfile, |
80 |
File& outfile, |
81 |
bool& retry_slow) { |
81 |
bool& retry_slow) { |
82 |
@@ -1246,12 +1254,26 @@ bool CopyFileContentsWithSendfile(File& infile, |
82 |
@@ -1241,17 +1249,36 @@ bool CopyFileContentsWithSendfile(File& infile, |
|
|
83 |
return false; |
84 |
} |
85 |
|
86 |
+#if defined(OS_BSD) |
87 |
+ off_t copied = 0; |
88 |
+ off_t res = 0; |
89 |
+#else |
90 |
size_t copied = 0; |
91 |
ssize_t res = 0; |
92 |
+#endif |
83 |
while (file_size - copied > 0) { |
93 |
while (file_size - copied > 0) { |
84 |
// Don't specify an offset and the kernel will begin reading/writing to the |
94 |
// Don't specify an offset and the kernel will begin reading/writing to the |
85 |
// current file offsets. |
95 |
// current file offsets. |
Lines 106-112
Link Here
|
106 |
|
116 |
|
107 |
copied += res; |
117 |
copied += res; |
108 |
} |
118 |
} |
109 |
@@ -1265,13 +1287,13 @@ bool CopyFileContentsWithSendfile(File& infile, |
119 |
@@ -1265,13 +1292,13 @@ bool CopyFileContentsWithSendfile(File& infile, |
110 |
|
120 |
|
111 |
return res >= 0; |
121 |
return res >= 0; |
112 |
} |
122 |
} |
Lines 122-128
Link Here
|
122 |
BASE_EXPORT bool IsPathExecutable(const FilePath& path) { |
132 |
BASE_EXPORT bool IsPathExecutable(const FilePath& path) { |
123 |
bool result = false; |
133 |
bool result = false; |
124 |
FilePath tmp_file_path; |
134 |
FilePath tmp_file_path; |
125 |
@@ -1292,6 +1314,6 @@ BASE_EXPORT bool IsPathExecutable(const FilePath& path |
135 |
@@ -1292,6 +1319,6 @@ BASE_EXPORT bool IsPathExecutable(const FilePath& path |
126 |
} |
136 |
} |
127 |
return result; |
137 |
return result; |
128 |
} |
138 |
} |
129 |
- |
|
|