Skip to content

Commit c6aacce

Browse files
Steve BlockJean-Baptiste Queru
authored andcommitted
Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)
Change-Id: I1de629b4632a4b3187ca1a28d6416daccd35f924
1 parent a51f0e7 commit c6aacce

File tree

295 files changed

+1916
-1916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+1916
-1916
lines changed

cmds/app_process/app_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class AppRuntime : public AndroidRuntime
7272
char* slashClassName = toSlashClassName(mClassName);
7373
mClass = env->FindClass(slashClassName);
7474
if (mClass == NULL) {
75-
LOGE("ERROR: could not find class '%s'\n", mClassName);
75+
ALOGE("ERROR: could not find class '%s'\n", mClassName);
7676
}
7777
free(slashClassName);
7878

cmds/bootanimation/BootAnimation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ BootAnimation::~BootAnimation() {
6969

7070
void BootAnimation::onFirstRef() {
7171
status_t err = mSession->linkToComposerDeath(this);
72-
LOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err));
72+
ALOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err));
7373
if (err == NO_ERROR) {
7474
run("BootAnimation", PRIORITY_DISPLAY);
7575
}
@@ -374,7 +374,7 @@ bool BootAnimation::movie()
374374
size_t numEntries = zip.getNumEntries();
375375
ZipEntryRO desc = zip.findEntryByName("desc.txt");
376376
FileMap* descMap = zip.createEntryFileMap(desc);
377-
LOGE_IF(!descMap, "descMap is null");
377+
ALOGE_IF(!descMap, "descMap is null");
378378
if (!descMap) {
379379
return false;
380380
}

cmds/dumpstate/dumpstate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,15 @@ int main(int argc, char *argv[]) {
317317
/* switch to non-root user and group */
318318
gid_t groups[] = { AID_LOG, AID_SDCARD_RW, AID_MOUNT, AID_INET };
319319
if (setgroups(sizeof(groups)/sizeof(groups[0]), groups) != 0) {
320-
LOGE("Unable to setgroups, aborting: %s\n", strerror(errno));
320+
ALOGE("Unable to setgroups, aborting: %s\n", strerror(errno));
321321
return -1;
322322
}
323323
if (setgid(AID_SHELL) != 0) {
324-
LOGE("Unable to setgid, aborting: %s\n", strerror(errno));
324+
ALOGE("Unable to setgid, aborting: %s\n", strerror(errno));
325325
return -1;
326326
}
327327
if (setuid(AID_SHELL) != 0) {
328-
LOGE("Unable to setuid, aborting: %s\n", strerror(errno));
328+
ALOGE("Unable to setuid, aborting: %s\n", strerror(errno));
329329
return -1;
330330
}
331331
}

cmds/dumpsys/dumpsys.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(int argc, char* const argv[])
3131
sp<IServiceManager> sm = defaultServiceManager();
3232
fflush(stdout);
3333
if (sm == NULL) {
34-
LOGE("Unable to get default service manager!");
34+
ALOGE("Unable to get default service manager!");
3535
aerr << "dumpsys: Unable to get default service manager!" << endl;
3636
return 20;
3737
}

cmds/installd/commands.c

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,47 +30,47 @@ int install(const char *pkgname, uid_t uid, gid_t gid)
3030
char libdir[PKG_PATH_MAX];
3131

3232
if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) {
33-
LOGE("invalid uid/gid: %d %d\n", uid, gid);
33+
ALOGE("invalid uid/gid: %d %d\n", uid, gid);
3434
return -1;
3535
}
3636

3737
if (create_pkg_path(pkgdir, pkgname, PKG_DIR_POSTFIX, 0)) {
38-
LOGE("cannot create package path\n");
38+
ALOGE("cannot create package path\n");
3939
return -1;
4040
}
4141

4242
if (create_pkg_path(libdir, pkgname, PKG_LIB_POSTFIX, 0)) {
43-
LOGE("cannot create package lib path\n");
43+
ALOGE("cannot create package lib path\n");
4444
return -1;
4545
}
4646

4747
if (mkdir(pkgdir, 0751) < 0) {
48-
LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
48+
ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
4949
return -errno;
5050
}
5151
if (chmod(pkgdir, 0751) < 0) {
52-
LOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
52+
ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
5353
unlink(pkgdir);
5454
return -errno;
5555
}
5656
if (chown(pkgdir, uid, gid) < 0) {
57-
LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
57+
ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
5858
unlink(pkgdir);
5959
return -errno;
6060
}
6161
if (mkdir(libdir, 0755) < 0) {
62-
LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
62+
ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
6363
unlink(pkgdir);
6464
return -errno;
6565
}
6666
if (chmod(libdir, 0755) < 0) {
67-
LOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno));
67+
ALOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno));
6868
unlink(libdir);
6969
unlink(pkgdir);
7070
return -errno;
7171
}
7272
if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
73-
LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
73+
ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
7474
unlink(libdir);
7575
unlink(pkgdir);
7676
return -errno;
@@ -100,7 +100,7 @@ int renamepkg(const char *oldpkgname, const char *newpkgname)
100100
return -1;
101101

102102
if (rename(oldpkgdir, newpkgdir) < 0) {
103-
LOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno));
103+
ALOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno));
104104
return -errno;
105105
}
106106
return 0;
@@ -127,11 +127,11 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona)
127127
return -1;
128128
}
129129
if (mkdir(pkgdir, 0751) < 0) {
130-
LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
130+
ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
131131
return -errno;
132132
}
133133
if (chown(pkgdir, uid, uid) < 0) {
134-
LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
134+
ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
135135
unlink(pkgdir);
136136
return -errno;
137137
}
@@ -165,7 +165,7 @@ static int64_t disk_free()
165165
if (statfs(android_data_dir.path, &sfs) == 0) {
166166
return sfs.f_bavail * sfs.f_bsize;
167167
} else {
168-
LOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno));
168+
ALOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno));
169169
return -1;
170170
}
171171
}
@@ -193,13 +193,13 @@ int free_cache(int64_t free_size)
193193
if (avail >= free_size) return 0;
194194

195195
if (create_persona_path(datadir, 0)) {
196-
LOGE("couldn't get directory for persona 0");
196+
ALOGE("couldn't get directory for persona 0");
197197
return -1;
198198
}
199199

200200
d = opendir(datadir);
201201
if (d == NULL) {
202-
LOGE("cannot open %s: %s\n", datadir, strerror(errno));
202+
ALOGE("cannot open %s: %s\n", datadir, strerror(errno));
203203
return -1;
204204
}
205205
dfd = dirfd(d);
@@ -245,7 +245,7 @@ int move_dex(const char *src, const char *dst)
245245

246246
ALOGV("move %s -> %s\n", src_dex, dst_dex);
247247
if (rename(src_dex, dst_dex) < 0) {
248-
LOGE("Couldn't move %s: %s\n", src_dex, strerror(errno));
248+
ALOGE("Couldn't move %s: %s\n", src_dex, strerror(errno));
249249
return -1;
250250
} else {
251251
return 0;
@@ -261,7 +261,7 @@ int rm_dex(const char *path)
261261

262262
ALOGV("unlink %s\n", dex_path);
263263
if (unlink(dex_path) < 0) {
264-
LOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno));
264+
ALOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno));
265265
return -1;
266266
} else {
267267
return 0;
@@ -281,12 +281,12 @@ int protect(char *pkgname, gid_t gid)
281281
if (stat(pkgpath, &s) < 0) return -1;
282282

283283
if (chown(pkgpath, s.st_uid, gid) < 0) {
284-
LOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno));
284+
ALOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno));
285285
return -1;
286286
}
287287

288288
if (chmod(pkgpath, S_IRUSR|S_IWUSR|S_IRGRP) < 0) {
289-
LOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno));
289+
ALOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno));
290290
return -1;
291291
}
292292

@@ -443,7 +443,7 @@ static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name,
443443

444444
execl(DEX_OPT_BIN, DEX_OPT_BIN, "--zip", zip_num, odex_num, input_file_name,
445445
dexopt_flags, (char*) NULL);
446-
LOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno));
446+
ALOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno));
447447
}
448448

449449
static int wait_dexopt(pid_t pid, const char* apk_path)
@@ -515,24 +515,24 @@ int dexopt(const char *apk_path, uid_t uid, int is_public)
515515

516516
zip_fd = open(apk_path, O_RDONLY, 0);
517517
if (zip_fd < 0) {
518-
LOGE("dexopt cannot open '%s' for input\n", apk_path);
518+
ALOGE("dexopt cannot open '%s' for input\n", apk_path);
519519
return -1;
520520
}
521521

522522
unlink(dex_path);
523523
odex_fd = open(dex_path, O_RDWR | O_CREAT | O_EXCL, 0644);
524524
if (odex_fd < 0) {
525-
LOGE("dexopt cannot open '%s' for output\n", dex_path);
525+
ALOGE("dexopt cannot open '%s' for output\n", dex_path);
526526
goto fail;
527527
}
528528
if (fchown(odex_fd, AID_SYSTEM, uid) < 0) {
529-
LOGE("dexopt cannot chown '%s'\n", dex_path);
529+
ALOGE("dexopt cannot chown '%s'\n", dex_path);
530530
goto fail;
531531
}
532532
if (fchmod(odex_fd,
533533
S_IRUSR|S_IWUSR|S_IRGRP |
534534
(is_public ? S_IROTH : 0)) < 0) {
535-
LOGE("dexopt cannot chmod '%s'\n", dex_path);
535+
ALOGE("dexopt cannot chmod '%s'\n", dex_path);
536536
goto fail;
537537
}
538538

@@ -543,15 +543,15 @@ int dexopt(const char *apk_path, uid_t uid, int is_public)
543543
if (pid == 0) {
544544
/* child -- drop privileges before continuing */
545545
if (setgid(uid) != 0) {
546-
LOGE("setgid(%d) failed during dexopt\n", uid);
546+
ALOGE("setgid(%d) failed during dexopt\n", uid);
547547
exit(64);
548548
}
549549
if (setuid(uid) != 0) {
550-
LOGE("setuid(%d) during dexopt\n", uid);
550+
ALOGE("setuid(%d) during dexopt\n", uid);
551551
exit(65);
552552
}
553553
if (flock(odex_fd, LOCK_EX | LOCK_NB) != 0) {
554-
LOGE("flock(%s) failed: %s\n", dex_path, strerror(errno));
554+
ALOGE("flock(%s) failed: %s\n", dex_path, strerror(errno));
555555
exit(66);
556556
}
557557

@@ -560,7 +560,7 @@ int dexopt(const char *apk_path, uid_t uid, int is_public)
560560
} else {
561561
res = wait_dexopt(pid, apk_path);
562562
if (res != 0) {
563-
LOGE("dexopt failed on '%s' res = %d\n", dex_path, res);
563+
ALOGE("dexopt failed on '%s' res = %d\n", dex_path, res);
564564
goto fail;
565565
}
566566
}
@@ -626,7 +626,7 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos,
626626
ALOGV("Renaming %s to %s (uid %d)\n", srcpath, dstpath, dstuid);
627627
if (rename(srcpath, dstpath) >= 0) {
628628
if (chown(dstpath, dstuid, dstgid) < 0) {
629-
LOGE("cannot chown %s: %s\n", dstpath, strerror(errno));
629+
ALOGE("cannot chown %s: %s\n", dstpath, strerror(errno));
630630
unlink(dstpath);
631631
return 1;
632632
}
@@ -852,30 +852,30 @@ int linklib(const char* dataDir, const char* asecLibDir)
852852

853853
const size_t libdirLen = strlen(dataDir) + strlen(PKG_LIB_POSTFIX);
854854
if (libdirLen >= PKG_PATH_MAX) {
855-
LOGE("library dir len too large");
855+
ALOGE("library dir len too large");
856856
return -1;
857857
}
858858

859859
if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) {
860-
LOGE("library dir not written successfully: %s\n", strerror(errno));
860+
ALOGE("library dir not written successfully: %s\n", strerror(errno));
861861
return -1;
862862
}
863863

864864
if (stat(dataDir, &s) < 0) return -1;
865865

866866
if (chown(dataDir, 0, 0) < 0) {
867-
LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
867+
ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
868868
return -1;
869869
}
870870

871871
if (chmod(dataDir, 0700) < 0) {
872-
LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
872+
ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
873873
rc = -1;
874874
goto out;
875875
}
876876

877877
if (lstat(libdir, &libStat) < 0) {
878-
LOGE("couldn't stat lib dir: %s\n", strerror(errno));
878+
ALOGE("couldn't stat lib dir: %s\n", strerror(errno));
879879
rc = -1;
880880
goto out;
881881
}
@@ -893,26 +893,26 @@ int linklib(const char* dataDir, const char* asecLibDir)
893893
}
894894

895895
if (symlink(asecLibDir, libdir) < 0) {
896-
LOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno));
896+
ALOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno));
897897
rc = -errno;
898898
goto out;
899899
}
900900

901901
if (lchown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
902-
LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
902+
ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
903903
unlink(libdir);
904904
rc = -errno;
905905
goto out;
906906
}
907907

908908
out:
909909
if (chmod(dataDir, s.st_mode) < 0) {
910-
LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
910+
ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
911911
return -errno;
912912
}
913913

914914
if (chown(dataDir, s.st_uid, s.st_gid) < 0) {
915-
LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
915+
ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
916916
return -errno;
917917
}
918918

@@ -931,28 +931,28 @@ int unlinklib(const char* dataDir)
931931
}
932932

933933
if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) {
934-
LOGE("library dir not written successfully: %s\n", strerror(errno));
934+
ALOGE("library dir not written successfully: %s\n", strerror(errno));
935935
return -1;
936936
}
937937

938938
if (stat(dataDir, &s) < 0) {
939-
LOGE("couldn't state data dir");
939+
ALOGE("couldn't state data dir");
940940
return -1;
941941
}
942942

943943
if (chown(dataDir, 0, 0) < 0) {
944-
LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
944+
ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
945945
return -1;
946946
}
947947

948948
if (chmod(dataDir, 0700) < 0) {
949-
LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
949+
ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
950950
rc = -1;
951951
goto out;
952952
}
953953

954954
if (lstat(libdir, &libStat) < 0) {
955-
LOGE("couldn't stat lib dir: %s\n", strerror(errno));
955+
ALOGE("couldn't stat lib dir: %s\n", strerror(errno));
956956
rc = -1;
957957
goto out;
958958
}
@@ -970,26 +970,26 @@ int unlinklib(const char* dataDir)
970970
}
971971

972972
if (mkdir(libdir, 0755) < 0) {
973-
LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
973+
ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
974974
rc = -errno;
975975
goto out;
976976
}
977977

978978
if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
979-
LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
979+
ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
980980
unlink(libdir);
981981
rc = -errno;
982982
goto out;
983983
}
984984

985985
out:
986986
if (chmod(dataDir, s.st_mode) < 0) {
987-
LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
987+
ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
988988
return -1;
989989
}
990990

991991
if (chown(dataDir, s.st_uid, s.st_gid) < 0) {
992-
LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
992+
ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
993993
return -1;
994994
}
995995

0 commit comments

Comments
 (0)