summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block2012-01-06 08:13:42 -0600
committerSteve Block2012-01-08 05:03:26 -0600
commit01dda204cd28fe181691b4a44a51be7e5666d0c8 (patch)
tree99ef6d14b55ebf4e2752cd182052caad6eddc20a /libdiskconfig
parent36afde3387fff9eac0e6d54854b8d43fe1ebb0cc (diff)
downloadplatform-system-core-01dda204cd28fe181691b4a44a51be7e5666d0c8.tar.gz
platform-system-core-01dda204cd28fe181691b4a44a51be7e5666d0c8.tar.xz
platform-system-core-01dda204cd28fe181691b4a44a51be7e5666d0c8.zip
Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
Bug: 5449033 Change-Id: Ibcffdcf620ebae1c389446ce8e9d908f11ac039c
Diffstat (limited to 'libdiskconfig')
-rw-r--r--libdiskconfig/config_mbr.c22
-rw-r--r--libdiskconfig/diskconfig.c72
-rw-r--r--libdiskconfig/diskutils.c12
-rw-r--r--libdiskconfig/dump_diskconfig.c2
-rw-r--r--libdiskconfig/write_lst.c6
5 files changed, 57 insertions, 57 deletions
diff --git a/libdiskconfig/config_mbr.c b/libdiskconfig/config_mbr.c
index 07bd6a79d..703484c21 100644
--- a/libdiskconfig/config_mbr.c
+++ b/libdiskconfig/config_mbr.c
@@ -62,7 +62,7 @@ kb_to_lba(uint32_t len_kb, uint32_t sect_size)
62 lba = (lba + (uint64_t)sect_size - 1) & ~((uint64_t)sect_size - 1); 62 lba = (lba + (uint64_t)sect_size - 1) & ~((uint64_t)sect_size - 1);
63 lba /= (uint64_t)sect_size; 63 lba /= (uint64_t)sect_size;
64 if (lba >= 0xffffffffULL) 64 if (lba >= 0xffffffffULL)
65 LOGE("Error converting kb -> lba. 32bit overflow, expect weirdness"); 65 ALOGE("Error converting kb -> lba. 32bit overflow, expect weirdness");
66 return (uint32_t)(lba & 0xffffffffULL); 66 return (uint32_t)(lba & 0xffffffffULL);
67} 67}
68 68
@@ -75,12 +75,12 @@ mk_pri_pentry(struct disk_info *dinfo, struct part_info *pinfo, int pnum,
75 struct pc_partition *pentry; 75 struct pc_partition *pentry;
76 76
77 if (pnum >= PC_NUM_BOOT_RECORD_PARTS) { 77 if (pnum >= PC_NUM_BOOT_RECORD_PARTS) {
78 LOGE("Maximum number of primary partition exceeded."); 78 ALOGE("Maximum number of primary partition exceeded.");
79 return NULL; 79 return NULL;
80 } 80 }
81 81
82 if (!(item = alloc_wl(sizeof(struct pc_partition)))) { 82 if (!(item = alloc_wl(sizeof(struct pc_partition)))) {
83 LOGE("Unable to allocate memory for partition entry."); 83 ALOGE("Unable to allocate memory for partition entry.");
84 return NULL; 84 return NULL;
85 } 85 }
86 86
@@ -146,7 +146,7 @@ mk_ext_pentry(struct disk_info *dinfo, struct part_info *pinfo, uint32_t *lba,
146 uint32_t len; /* in lba units */ 146 uint32_t len; /* in lba units */
147 147
148 if (!(item = alloc_wl(sizeof(struct pc_boot_record)))) { 148 if (!(item = alloc_wl(sizeof(struct pc_boot_record)))) {
149 LOGE("Unable to allocate memory for EBR."); 149 ALOGE("Unable to allocate memory for EBR.");
150 return NULL; 150 return NULL;
151 } 151 }
152 152
@@ -163,7 +163,7 @@ mk_ext_pentry(struct disk_info *dinfo, struct part_info *pinfo, uint32_t *lba,
163 len = kb_to_lba(pinfo->len_kb, dinfo->sect_size); 163 len = kb_to_lba(pinfo->len_kb, dinfo->sect_size);
164 else { 164 else {
165 if (pnext) { 165 if (pnext) {
166 LOGE("Only the last partition can be specified to fill the disk " 166 ALOGE("Only the last partition can be specified to fill the disk "
167 "(name = '%s')", pinfo->name); 167 "(name = '%s')", pinfo->name);
168 goto fail; 168 goto fail;
169 } 169 }
@@ -233,7 +233,7 @@ config_mbr(struct disk_info *dinfo)
233 if ((temp_wr = mk_pri_pentry(dinfo, NULL, cnt, &cur_lba))) 233 if ((temp_wr = mk_pri_pentry(dinfo, NULL, cnt, &cur_lba)))
234 wlist_add(&wr_list, temp_wr); 234 wlist_add(&wr_list, temp_wr);
235 else { 235 else {
236 LOGE("Cannot create primary extended partition."); 236 ALOGE("Cannot create primary extended partition.");
237 goto fail; 237 goto fail;
238 } 238 }
239 } 239 }
@@ -259,7 +259,7 @@ config_mbr(struct disk_info *dinfo)
259 if (temp_wr) 259 if (temp_wr)
260 wlist_add(&wr_list, temp_wr); 260 wlist_add(&wr_list, temp_wr);
261 else { 261 else {
262 LOGE("Cannot create partition %d (%s).", cnt, pinfo->name); 262 ALOGE("Cannot create partition %d (%s).", cnt, pinfo->name);
263 goto fail; 263 goto fail;
264 } 264 }
265 } 265 }
@@ -270,7 +270,7 @@ config_mbr(struct disk_info *dinfo)
270 cur_lba = 0; 270 cur_lba = 0;
271 memset(&blank, 0, sizeof(struct part_info)); 271 memset(&blank, 0, sizeof(struct part_info));
272 if (!(temp_wr = mk_pri_pentry(dinfo, &blank, cnt, &cur_lba))) { 272 if (!(temp_wr = mk_pri_pentry(dinfo, &blank, cnt, &cur_lba))) {
273 LOGE("Cannot create blank partition %d.", cnt); 273 ALOGE("Cannot create blank partition %d.", cnt);
274 goto fail; 274 goto fail;
275 } 275 }
276 wlist_add(&wr_list, temp_wr); 276 wlist_add(&wr_list, temp_wr);
@@ -279,7 +279,7 @@ config_mbr(struct disk_info *dinfo)
279 return wr_list; 279 return wr_list;
280 280
281nospace: 281nospace:
282 LOGE("Not enough space to add parttion '%s'.", pinfo->name); 282 ALOGE("Not enough space to add parttion '%s'.", pinfo->name);
283 283
284fail: 284fail:
285 wlist_free(wr_list); 285 wlist_free(wr_list);
@@ -310,13 +310,13 @@ find_mbr_part(struct disk_info *dinfo, const char *name)
310 num++; 310 num++;
311 311
312 if (!(dev_name = malloc(MAX_NAME_LEN))) { 312 if (!(dev_name = malloc(MAX_NAME_LEN))) {
313 LOGE("Cannot allocate memory."); 313 ALOGE("Cannot allocate memory.");
314 return NULL; 314 return NULL;
315 } 315 }
316 316
317 num = snprintf(dev_name, MAX_NAME_LEN, "%s%d", dinfo->device, num); 317 num = snprintf(dev_name, MAX_NAME_LEN, "%s%d", dinfo->device, num);
318 if (num >= MAX_NAME_LEN) { 318 if (num >= MAX_NAME_LEN) {
319 LOGE("Device name is too long?!"); 319 ALOGE("Device name is too long?!");
320 free(dev_name); 320 free(dev_name);
321 return NULL; 321 return NULL;
322 } 322 }
diff --git a/libdiskconfig/diskconfig.c b/libdiskconfig/diskconfig.c
index 66bd0c39b..d5425de03 100644
--- a/libdiskconfig/diskconfig.c
+++ b/libdiskconfig/diskconfig.c
@@ -45,7 +45,7 @@ parse_len(const char *str, uint64_t *plen)
45 tmp[sizeof(tmp)-1] = '\0'; 45 tmp[sizeof(tmp)-1] = '\0';
46 len_str = strlen(tmp); 46 len_str = strlen(tmp);
47 if (!len_str) { 47 if (!len_str) {
48 LOGE("Invalid disk length specified."); 48 ALOGE("Invalid disk length specified.");
49 return 1; 49 return 1;
50 } 50 }
51 51
@@ -64,13 +64,13 @@ parse_len(const char *str, uint64_t *plen)
64 64
65 *plen = strtoull(tmp, NULL, 0); 65 *plen = strtoull(tmp, NULL, 0);
66 if (!*plen) { 66 if (!*plen) {
67 LOGE("Invalid length specified: %s", str); 67 ALOGE("Invalid length specified: %s", str);
68 return 1; 68 return 1;
69 } 69 }
70 70
71 if (*plen == (uint64_t)-1) { 71 if (*plen == (uint64_t)-1) {
72 if (multiple > 1) { 72 if (multiple > 1) {
73 LOGE("Size modifier illegal when len is -1"); 73 ALOGE("Size modifier illegal when len is -1");
74 return 1; 74 return 1;
75 } 75 }
76 } else { 76 } else {
@@ -80,7 +80,7 @@ parse_len(const char *str, uint64_t *plen)
80 *plen *= multiple; 80 *plen *= multiple;
81 81
82 if (*plen > 0xffffffffULL) { 82 if (*plen > 0xffffffffULL) {
83 LOGE("Length specified is too large!: %llu KB", *plen); 83 ALOGE("Length specified is too large!: %llu KB", *plen);
84 return 1; 84 return 1;
85 } 85 }
86 } 86 }
@@ -108,7 +108,7 @@ load_partitions(cnode *root, struct disk_info *dinfo)
108 pinfo->flags |= PART_ACTIVE_FLAG; 108 pinfo->flags |= PART_ACTIVE_FLAG;
109 109
110 if (!(tmp = config_str(partnode, "type", NULL))) { 110 if (!(tmp = config_str(partnode, "type", NULL))) {
111 LOGE("Partition type required: %s", pinfo->name); 111 ALOGE("Partition type required: %s", pinfo->name);
112 return 1; 112 return 1;
113 } 113 }
114 114
@@ -118,7 +118,7 @@ load_partitions(cnode *root, struct disk_info *dinfo)
118 } else if (!strcmp(tmp, "fat32")) { 118 } else if (!strcmp(tmp, "fat32")) {
119 pinfo->type = PC_PART_TYPE_FAT32; 119 pinfo->type = PC_PART_TYPE_FAT32;
120 } else { 120 } else {
121 LOGE("Unsupported partition type found: %s", tmp); 121 ALOGE("Unsupported partition type found: %s", tmp);
122 return 1; 122 return 1;
123 } 123 }
124 124
@@ -146,13 +146,13 @@ load_diskconfig(const char *fn, char *path_override)
146 const char *tmp; 146 const char *tmp;
147 147
148 if (!(dinfo = malloc(sizeof(struct disk_info)))) { 148 if (!(dinfo = malloc(sizeof(struct disk_info)))) {
149 LOGE("Could not malloc disk_info"); 149 ALOGE("Could not malloc disk_info");
150 return NULL; 150 return NULL;
151 } 151 }
152 memset(dinfo, 0, sizeof(struct disk_info)); 152 memset(dinfo, 0, sizeof(struct disk_info));
153 153
154 if (!(dinfo->part_lst = malloc(MAX_NUM_PARTS * sizeof(struct part_info)))) { 154 if (!(dinfo->part_lst = malloc(MAX_NUM_PARTS * sizeof(struct part_info)))) {
155 LOGE("Could not malloc part_lst"); 155 ALOGE("Could not malloc part_lst");
156 goto fail; 156 goto fail;
157 } 157 }
158 memset(dinfo->part_lst, 0, 158 memset(dinfo->part_lst, 0,
@@ -160,33 +160,33 @@ load_diskconfig(const char *fn, char *path_override)
160 160
161 config_load_file(root, fn); 161 config_load_file(root, fn);
162 if (root->first_child == NULL) { 162 if (root->first_child == NULL) {
163 LOGE("Could not read config file %s", fn); 163 ALOGE("Could not read config file %s", fn);
164 goto fail; 164 goto fail;
165 } 165 }
166 166
167 if (!(devroot = config_find(root, "device"))) { 167 if (!(devroot = config_find(root, "device"))) {
168 LOGE("Could not find device section in config file '%s'", fn); 168 ALOGE("Could not find device section in config file '%s'", fn);
169 goto fail; 169 goto fail;
170 } 170 }
171 171
172 172
173 if (!(tmp = config_str(devroot, "path", path_override))) { 173 if (!(tmp = config_str(devroot, "path", path_override))) {
174 LOGE("device path is requried"); 174 ALOGE("device path is requried");
175 goto fail; 175 goto fail;
176 } 176 }
177 dinfo->device = strdup(tmp); 177 dinfo->device = strdup(tmp);
178 178
179 /* find the partition scheme */ 179 /* find the partition scheme */
180 if (!(tmp = config_str(devroot, "scheme", NULL))) { 180 if (!(tmp = config_str(devroot, "scheme", NULL))) {
181 LOGE("partition scheme is required"); 181 ALOGE("partition scheme is required");
182 goto fail; 182 goto fail;
183 } else if (!strcmp(tmp, "mbr")) { 183 } else if (!strcmp(tmp, "mbr")) {
184 dinfo->scheme = PART_SCHEME_MBR; 184 dinfo->scheme = PART_SCHEME_MBR;
185 } else if (!strcmp(tmp, "gpt")) { 185 } else if (!strcmp(tmp, "gpt")) {
186 LOGE("'gpt' partition scheme not supported yet."); 186 ALOGE("'gpt' partition scheme not supported yet.");
187 goto fail; 187 goto fail;
188 } else { 188 } else {
189 LOGE("Unknown partition scheme specified: %s", tmp); 189 ALOGE("Unknown partition scheme specified: %s", tmp);
190 goto fail; 190 goto fail;
191 } 191 }
192 192
@@ -194,30 +194,30 @@ load_diskconfig(const char *fn, char *path_override)
194 tmp = config_str(devroot, "sector_size", "512"); 194 tmp = config_str(devroot, "sector_size", "512");
195 dinfo->sect_size = strtol(tmp, NULL, 0); 195 dinfo->sect_size = strtol(tmp, NULL, 0);
196 if (!dinfo->sect_size) { 196 if (!dinfo->sect_size) {
197 LOGE("Invalid sector size: %s", tmp); 197 ALOGE("Invalid sector size: %s", tmp);
198 goto fail; 198 goto fail;
199 } 199 }
200 200
201 /* first lba where the partitions will start on disk */ 201 /* first lba where the partitions will start on disk */
202 if (!(tmp = config_str(devroot, "start_lba", NULL))) { 202 if (!(tmp = config_str(devroot, "start_lba", NULL))) {
203 LOGE("start_lba must be provided"); 203 ALOGE("start_lba must be provided");
204 goto fail; 204 goto fail;
205 } 205 }
206 206
207 if (!(dinfo->skip_lba = strtol(tmp, NULL, 0))) { 207 if (!(dinfo->skip_lba = strtol(tmp, NULL, 0))) {
208 LOGE("Invalid starting LBA (or zero): %s", tmp); 208 ALOGE("Invalid starting LBA (or zero): %s", tmp);
209 goto fail; 209 goto fail;
210 } 210 }
211 211
212 /* Number of LBAs on disk */ 212 /* Number of LBAs on disk */
213 if (!(tmp = config_str(devroot, "num_lba", NULL))) { 213 if (!(tmp = config_str(devroot, "num_lba", NULL))) {
214 LOGE("num_lba is required"); 214 ALOGE("num_lba is required");
215 goto fail; 215 goto fail;
216 } 216 }
217 dinfo->num_lba = strtoul(tmp, NULL, 0); 217 dinfo->num_lba = strtoul(tmp, NULL, 0);
218 218
219 if (!(partnode = config_find(devroot, "partitions"))) { 219 if (!(partnode = config_find(devroot, "partitions"))) {
220 LOGE("Device must specify partition list"); 220 ALOGE("Device must specify partition list");
221 goto fail; 221 goto fail;
222 } 222 }
223 223
@@ -244,12 +244,12 @@ sync_ptable(int fd)
244 sync(); 244 sync();
245 245
246 if (fstat(fd, &stat)) { 246 if (fstat(fd, &stat)) {
247 LOGE("Cannot stat, errno=%d.", errno); 247 ALOGE("Cannot stat, errno=%d.", errno);
248 return -1; 248 return -1;
249 } 249 }
250 250
251 if (S_ISBLK(stat.st_mode) && ((rv = ioctl(fd, BLKRRPART, NULL)) < 0)) { 251 if (S_ISBLK(stat.st_mode) && ((rv = ioctl(fd, BLKRRPART, NULL)) < 0)) {
252 LOGE("Could not re-read partition table. REBOOT!. (errno=%d)", errno); 252 ALOGE("Could not re-read partition table. REBOOT!. (errno=%d)", errno);
253 return -1; 253 return -1;
254 } 254 }
255 255
@@ -281,12 +281,12 @@ validate(struct disk_info *dinfo)
281 return -1; 281 return -1;
282 282
283 if ((fd = open(dinfo->device, O_RDWR)) < 0) { 283 if ((fd = open(dinfo->device, O_RDWR)) < 0) {
284 LOGE("Cannot open device '%s' (errno=%d)", dinfo->device, errno); 284 ALOGE("Cannot open device '%s' (errno=%d)", dinfo->device, errno);
285 return -1; 285 return -1;
286 } 286 }
287 287
288 if (fstat(fd, &stat)) { 288 if (fstat(fd, &stat)) {
289 LOGE("Cannot stat file '%s', errno=%d.", dinfo->device, errno); 289 ALOGE("Cannot stat file '%s', errno=%d.", dinfo->device, errno);
290 goto fail; 290 goto fail;
291 } 291 }
292 292
@@ -299,19 +299,19 @@ validate(struct disk_info *dinfo)
299 if (S_ISBLK(stat.st_mode)) { 299 if (S_ISBLK(stat.st_mode)) {
300 /* get the sector size and make sure we agree */ 300 /* get the sector size and make sure we agree */
301 if (ioctl(fd, BLKSSZGET, &sect_sz) < 0) { 301 if (ioctl(fd, BLKSSZGET, &sect_sz) < 0) {
302 LOGE("Cannot get sector size (errno=%d)", errno); 302 ALOGE("Cannot get sector size (errno=%d)", errno);
303 goto fail; 303 goto fail;
304 } 304 }
305 305
306 if (!sect_sz || sect_sz != dinfo->sect_size) { 306 if (!sect_sz || sect_sz != dinfo->sect_size) {
307 LOGE("Device sector size is zero or sector sizes do not match!"); 307 ALOGE("Device sector size is zero or sector sizes do not match!");
308 goto fail; 308 goto fail;
309 } 309 }
310 310
311 /* allow the user override the "disk size" if they provided num_lba */ 311 /* allow the user override the "disk size" if they provided num_lba */
312 if (!dinfo->num_lba) { 312 if (!dinfo->num_lba) {
313 if (ioctl(fd, BLKGETSIZE64, &disk_size) < 0) { 313 if (ioctl(fd, BLKGETSIZE64, &disk_size) < 0) {
314 LOGE("Could not get block device size (errno=%d)", errno); 314 ALOGE("Could not get block device size (errno=%d)", errno);
315 goto fail; 315 goto fail;
316 } 316 }
317 /* XXX: we assume that the disk has < 2^32 sectors :-) */ 317 /* XXX: we assume that the disk has < 2^32 sectors :-) */
@@ -321,7 +321,7 @@ validate(struct disk_info *dinfo)
321 } else if (S_ISREG(stat.st_mode)) { 321 } else if (S_ISREG(stat.st_mode)) {
322 ALOGI("Requesting operation on a regular file, not block device."); 322 ALOGI("Requesting operation on a regular file, not block device.");
323 if (!dinfo->sect_size) { 323 if (!dinfo->sect_size) {
324 LOGE("Sector size for regular file images cannot be zero"); 324 ALOGE("Sector size for regular file images cannot be zero");
325 goto fail; 325 goto fail;
326 } 326 }
327 if (dinfo->num_lba) 327 if (dinfo->num_lba)
@@ -331,7 +331,7 @@ validate(struct disk_info *dinfo)
331 disk_size = (uint64_t)stat.st_size; 331 disk_size = (uint64_t)stat.st_size;
332 } 332 }
333 } else { 333 } else {
334 LOGE("Device does not refer to a regular file or a block device!"); 334 ALOGE("Device does not refer to a regular file or a block device!");
335 goto fail; 335 goto fail;
336 } 336 }
337 337
@@ -350,12 +350,12 @@ validate(struct disk_info *dinfo)
350 if (part->len_kb != (uint32_t)-1) { 350 if (part->len_kb != (uint32_t)-1) {
351 total_size += part->len_kb * 1024; 351 total_size += part->len_kb * 1024;
352 } else if (part->len_kb == 0) { 352 } else if (part->len_kb == 0) {
353 LOGE("Zero-size partition '%s' is invalid.", part->name); 353 ALOGE("Zero-size partition '%s' is invalid.", part->name);
354 goto fail; 354 goto fail;
355 } else { 355 } else {
356 /* the partition requests the rest of the disk. */ 356 /* the partition requests the rest of the disk. */
357 if (cnt + 1 != dinfo->num_parts) { 357 if (cnt + 1 != dinfo->num_parts) {
358 LOGE("Only the last partition in the list can request to fill " 358 ALOGE("Only the last partition in the list can request to fill "
359 "the rest of disk."); 359 "the rest of disk.");
360 goto fail; 360 goto fail;
361 } 361 }
@@ -363,7 +363,7 @@ validate(struct disk_info *dinfo)
363 363
364 if ((part->type != PC_PART_TYPE_LINUX) && 364 if ((part->type != PC_PART_TYPE_LINUX) &&
365 (part->type != PC_PART_TYPE_FAT32)) { 365 (part->type != PC_PART_TYPE_FAT32)) {
366 LOGE("Unknown partition type (0x%x) encountered for partition " 366 ALOGE("Unknown partition type (0x%x) encountered for partition "
367 "'%s'\n", part->type, part->name); 367 "'%s'\n", part->type, part->name);
368 goto fail; 368 goto fail;
369 } 369 }
@@ -371,7 +371,7 @@ validate(struct disk_info *dinfo)
371 371
372 /* only matters for disks, not files */ 372 /* only matters for disks, not files */
373 if (S_ISBLK(stat.st_mode) && total_size > disk_size) { 373 if (S_ISBLK(stat.st_mode) && total_size > disk_size) {
374 LOGE("Total requested size of partitions (%llu) is greater than disk " 374 ALOGE("Total requested size of partitions (%llu) is greater than disk "
375 "size (%llu).", total_size, disk_size); 375 "size (%llu).", total_size, disk_size);
376 goto fail; 376 goto fail;
377 } 377 }
@@ -399,7 +399,7 @@ validate_and_config(struct disk_info *dinfo, int *fd, struct write_list **lst)
399 case PART_SCHEME_GPT: 399 case PART_SCHEME_GPT:
400 /* not supported yet */ 400 /* not supported yet */
401 default: 401 default:
402 LOGE("Uknown partition scheme."); 402 ALOGE("Uknown partition scheme.");
403 break; 403 break;
404 } 404 }
405 405
@@ -438,7 +438,7 @@ apply_disk_config(struct disk_info *dinfo, int test)
438 int rv; 438 int rv;
439 439
440 if (validate_and_config(dinfo, &fd, &wr_lst) != 0) { 440 if (validate_and_config(dinfo, &fd, &wr_lst) != 0) {
441 LOGE("Configuration is invalid."); 441 ALOGE("Configuration is invalid.");
442 goto fail; 442 goto fail;
443 } 443 }
444 444
@@ -523,10 +523,10 @@ find_part_device(struct disk_info *dinfo, const char *name)
523 case PART_SCHEME_MBR: 523 case PART_SCHEME_MBR:
524 return find_mbr_part(dinfo, name); 524 return find_mbr_part(dinfo, name);
525 case PART_SCHEME_GPT: 525 case PART_SCHEME_GPT:
526 LOGE("GPT is presently not supported"); 526 ALOGE("GPT is presently not supported");
527 break; 527 break;
528 default: 528 default:
529 LOGE("Unknown partition table scheme"); 529 ALOGE("Unknown partition table scheme");
530 break; 530 break;
531 } 531 }
532 532
diff --git a/libdiskconfig/diskutils.c b/libdiskconfig/diskutils.c
index be35763e8..e32573543 100644
--- a/libdiskconfig/diskutils.c
+++ b/libdiskconfig/diskutils.c
@@ -42,18 +42,18 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test)
42 42
43 ALOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, offset); 43 ALOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, offset);
44 if ((src_fd = open(src, O_RDONLY)) < 0) { 44 if ((src_fd = open(src, O_RDONLY)) < 0) {
45 LOGE("Could not open %s for reading (errno=%d).", src, errno); 45 ALOGE("Could not open %s for reading (errno=%d).", src, errno);
46 goto fail; 46 goto fail;
47 } 47 }
48 48
49 if (!test) { 49 if (!test) {
50 if ((dst_fd = open(dst, O_RDWR)) < 0) { 50 if ((dst_fd = open(dst, O_RDWR)) < 0) {
51 LOGE("Could not open '%s' for read/write (errno=%d).", dst, errno); 51 ALOGE("Could not open '%s' for read/write (errno=%d).", dst, errno);
52 goto fail; 52 goto fail;
53 } 53 }
54 54
55 if (lseek64(dst_fd, offset, SEEK_SET) != offset) { 55 if (lseek64(dst_fd, offset, SEEK_SET) != offset) {
56 LOGE("Could not seek to offset %lld in %s.", offset, dst); 56 ALOGE("Could not seek to offset %lld in %s.", offset, dst);
57 goto fail; 57 goto fail;
58 } 58 }
59 } 59 }
@@ -63,7 +63,7 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test)
63 /* XXX: Should we not even bother with EINTR? */ 63 /* XXX: Should we not even bother with EINTR? */
64 if (errno == EINTR) 64 if (errno == EINTR)
65 continue; 65 continue;
66 LOGE("Error (%d) while reading from '%s'", errno, src); 66 ALOGE("Error (%d) while reading from '%s'", errno, src);
67 goto fail; 67 goto fail;
68 } 68 }
69 69
@@ -84,7 +84,7 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test)
84 /* XXX: Should we not even bother with EINTR? */ 84 /* XXX: Should we not even bother with EINTR? */
85 if (errno == EINTR) 85 if (errno == EINTR)
86 continue; 86 continue;
87 LOGE("Error (%d) while writing to '%s'", errno, dst); 87 ALOGE("Error (%d) while writing to '%s'", errno, dst);
88 goto fail; 88 goto fail;
89 } 89 }
90 if (!tmp) 90 if (!tmp)
@@ -94,7 +94,7 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test)
94 } 94 }
95 95
96 if (!done) { 96 if (!done) {
97 LOGE("Exited read/write loop without setting flag! WTF?!"); 97 ALOGE("Exited read/write loop without setting flag! WTF?!");
98 goto fail; 98 goto fail;
99 } 99 }
100 100
diff --git a/libdiskconfig/dump_diskconfig.c b/libdiskconfig/dump_diskconfig.c
index fff19f5ab..75256f616 100644
--- a/libdiskconfig/dump_diskconfig.c
+++ b/libdiskconfig/dump_diskconfig.c
@@ -28,7 +28,7 @@ main(int argc, char *argv[])
28 struct disk_info *dinfo; 28 struct disk_info *dinfo;
29 29
30 if (argc < 2) { 30 if (argc < 2) {
31 LOGE("usage: %s <conf file>", argv[0]); 31 ALOGE("usage: %s <conf file>", argv[0]);
32 return 1; 32 return 1;
33 } 33 }
34 34
diff --git a/libdiskconfig/write_lst.c b/libdiskconfig/write_lst.c
index d99a80774..826ef7a3c 100644
--- a/libdiskconfig/write_lst.c
+++ b/libdiskconfig/write_lst.c
@@ -32,7 +32,7 @@ alloc_wl(uint32_t data_len)
32 struct write_list *item; 32 struct write_list *item;
33 33
34 if (!(item = malloc(sizeof(struct write_list) + data_len))) { 34 if (!(item = malloc(sizeof(struct write_list) + data_len))) {
35 LOGE("Unable to allocate memory."); 35 ALOGE("Unable to allocate memory.");
36 return NULL; 36 return NULL;
37 } 37 }
38 38
@@ -71,13 +71,13 @@ wlist_commit(int fd, struct write_list *lst, int test)
71{ 71{
72 for(; lst; lst = lst->next) { 72 for(; lst; lst = lst->next) {
73 if (lseek64(fd, lst->offset, SEEK_SET) != (loff_t)lst->offset) { 73 if (lseek64(fd, lst->offset, SEEK_SET) != (loff_t)lst->offset) {
74 LOGE("Cannot seek to the specified position (%lld).", lst->offset); 74 ALOGE("Cannot seek to the specified position (%lld).", lst->offset);
75 goto fail; 75 goto fail;
76 } 76 }
77 77
78 if (!test) { 78 if (!test) {
79 if (write(fd, lst->data, lst->len) != (int)lst->len) { 79 if (write(fd, lst->data, lst->len) != (int)lst->len) {
80 LOGE("Failed writing %u bytes at position %lld.", lst->len, 80 ALOGE("Failed writing %u bytes at position %lld.", lst->len,
81 lst->offset); 81 lst->offset);
82 goto fail; 82 goto fail;
83 } 83 }