summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross2012-06-08 18:55:35 -0500
committerColin Cross2012-07-10 00:09:37 -0500
commitb43828b247fd4f1e0373584de0504004c69eeac9 (patch)
tree57141bc0f9b57cb3c7da4106e9276452da30ef90 /libsparse
parent317a09e2d47257df5e0972c85f14c2a6ffdbbfd2 (diff)
downloadplatform-system-core-b43828b247fd4f1e0373584de0504004c69eeac9.tar.gz
platform-system-core-b43828b247fd4f1e0373584de0504004c69eeac9.tar.xz
platform-system-core-b43828b247fd4f1e0373584de0504004c69eeac9.zip
libsparse: rename symbols that conflict with libext4_utils
Until ext4_utils switches to using libsparse, libext4_utils defines some of the same symbols as libsparse. Fastboot links statically against both of them, and there is no easy way to make the symbols hidden, so just rename them in libsparse. Change-Id: Idc2cfe20efe3c3a7fb8233f453a89bbbeb0dcc8b
Diffstat (limited to 'libsparse')
-rw-r--r--libsparse/output_file.c6
-rw-r--r--libsparse/output_file.h6
-rw-r--r--libsparse/sparse.c16
3 files changed, 14 insertions, 14 deletions
diff --git a/libsparse/output_file.c b/libsparse/output_file.c
index dc56149e7..b5ae4191f 100644
--- a/libsparse/output_file.c
+++ b/libsparse/output_file.c
@@ -541,7 +541,7 @@ static struct sparse_file_ops normal_file_ops = {
541 .write_end_chunk = write_normal_end_chunk, 541 .write_end_chunk = write_normal_end_chunk,
542}; 542};
543 543
544void close_output_file(struct output_file *out) 544void output_file_close(struct output_file *out)
545{ 545{
546 int ret; 546 int ret;
547 547
@@ -638,7 +638,7 @@ static struct output_file *output_file_new_normal(void)
638 return &outn->out; 638 return &outn->out;
639} 639}
640 640
641struct output_file *open_output_callback(int (*write)(void *, const void *, int), 641struct output_file *output_file_open_callback(int (*write)(void *, const void *, int),
642 void *priv, unsigned int block_size, int64_t len, int gz, int sparse, 642 void *priv, unsigned int block_size, int64_t len, int gz, int sparse,
643 int chunks, int crc) 643 int chunks, int crc)
644{ 644{
@@ -664,7 +664,7 @@ struct output_file *open_output_callback(int (*write)(void *, const void *, int)
664 return &outc->out; 664 return &outc->out;
665} 665}
666 666
667struct output_file *open_output_fd(int fd, unsigned int block_size, int64_t len, 667struct output_file *output_file_open_fd(int fd, unsigned int block_size, int64_t len,
668 int gz, int sparse, int chunks, int crc) 668 int gz, int sparse, int chunks, int crc)
669{ 669{
670 int ret; 670 int ret;
diff --git a/libsparse/output_file.h b/libsparse/output_file.h
index 7a9fa2434..474c1fc21 100644
--- a/libsparse/output_file.h
+++ b/libsparse/output_file.h
@@ -21,9 +21,9 @@
21 21
22struct output_file; 22struct output_file;
23 23
24struct output_file *open_output_fd(int fd, unsigned int block_size, int64_t len, 24struct output_file *output_file_open_fd(int fd, unsigned int block_size, int64_t len,
25 int gz, int sparse, int chunks, int crc); 25 int gz, int sparse, int chunks, int crc);
26struct output_file *open_output_callback(int (*write)(void *, const void *, int), 26struct output_file *output_file_open_callback(int (*write)(void *, const void *, int),
27 void *priv, unsigned int block_size, int64_t len, int gz, int sparse, 27 void *priv, unsigned int block_size, int64_t len, int gz, int sparse,
28 int chunks, int crc); 28 int chunks, int crc);
29int write_data_chunk(struct output_file *out, unsigned int len, void *data); 29int write_data_chunk(struct output_file *out, unsigned int len, void *data);
@@ -34,7 +34,7 @@ int write_file_chunk(struct output_file *out, unsigned int len,
34int write_fd_chunk(struct output_file *out, unsigned int len, 34int write_fd_chunk(struct output_file *out, unsigned int len,
35 int fd, int64_t offset); 35 int fd, int64_t offset);
36int write_skip_chunk(struct output_file *out, int64_t len); 36int write_skip_chunk(struct output_file *out, int64_t len);
37void close_output_file(struct output_file *out); 37void output_file_close(struct output_file *out);
38 38
39int read_all(int fd, void *buf, size_t len); 39int read_all(int fd, void *buf, size_t len);
40 40
diff --git a/libsparse/sparse.c b/libsparse/sparse.c
index f04f687b9..189b4c03e 100644
--- a/libsparse/sparse.c
+++ b/libsparse/sparse.c
@@ -156,14 +156,14 @@ int sparse_file_write(struct sparse_file *s, int fd, bool gz, bool sparse,
156 struct output_file *out; 156 struct output_file *out;
157 157
158 chunks = sparse_count_chunks(s); 158 chunks = sparse_count_chunks(s);
159 out = open_output_fd(fd, s->block_size, s->len, gz, sparse, chunks, crc); 159 out = output_file_open_fd(fd, s->block_size, s->len, gz, sparse, chunks, crc);
160 160
161 if (!out) 161 if (!out)
162 return -ENOMEM; 162 return -ENOMEM;
163 163
164 ret = write_all_blocks(s, out); 164 ret = write_all_blocks(s, out);
165 165
166 close_output_file(out); 166 output_file_close(out);
167 167
168 return ret; 168 return ret;
169} 169}
@@ -176,7 +176,7 @@ int sparse_file_callback(struct sparse_file *s, bool sparse, bool crc,
176 struct output_file *out; 176 struct output_file *out;
177 177
178 chunks = sparse_count_chunks(s); 178 chunks = sparse_count_chunks(s);
179 out = open_output_callback(write, priv, s->block_size, s->len, false, 179 out = output_file_open_callback(write, priv, s->block_size, s->len, false,
180 sparse, chunks, crc); 180 sparse, chunks, crc);
181 181
182 if (!out) 182 if (!out)
@@ -184,7 +184,7 @@ int sparse_file_callback(struct sparse_file *s, bool sparse, bool crc,
184 184
185 ret = write_all_blocks(s, out); 185 ret = write_all_blocks(s, out);
186 186
187 close_output_file(out); 187 output_file_close(out);
188 188
189 return ret; 189 return ret;
190} 190}
@@ -203,7 +203,7 @@ int64_t sparse_file_len(struct sparse_file *s, bool sparse, bool crc)
203 int64_t count = 0; 203 int64_t count = 0;
204 struct output_file *out; 204 struct output_file *out;
205 205
206 out = open_output_callback(out_counter_write, &count, 206 out = output_file_open_callback(out_counter_write, &count,
207 s->block_size, s->len, false, sparse, chunks, crc); 207 s->block_size, s->len, false, sparse, chunks, crc);
208 if (!out) { 208 if (!out) {
209 return -1; 209 return -1;
@@ -211,7 +211,7 @@ int64_t sparse_file_len(struct sparse_file *s, bool sparse, bool crc)
211 211
212 ret = write_all_blocks(s, out); 212 ret = write_all_blocks(s, out);
213 213
214 close_output_file(out); 214 output_file_close(out);
215 215
216 if (ret < 0) { 216 if (ret < 0) {
217 return -1; 217 return -1;
@@ -239,7 +239,7 @@ static struct backed_block *move_chunks_up_to_len(struct sparse_file *from,
239 len -= overhead; 239 len -= overhead;
240 240
241 start = backed_block_iter_new(from->backed_block_list); 241 start = backed_block_iter_new(from->backed_block_list);
242 out_counter = open_output_callback(out_counter_write, &count, 242 out_counter = output_file_open_callback(out_counter_write, &count,
243 to->block_size, to->len, false, true, 0, false); 243 to->block_size, to->len, false, true, 0, false);
244 if (!out_counter) { 244 if (!out_counter) {
245 return NULL; 245 return NULL;
@@ -269,7 +269,7 @@ out:
269 backed_block_list_move(from->backed_block_list, 269 backed_block_list_move(from->backed_block_list,
270 to->backed_block_list, start, last_bb); 270 to->backed_block_list, start, last_bb);
271 271
272 close_output_file(out_counter); 272 output_file_close(out_counter);
273 273
274 return bb; 274 return bb;
275} 275}