summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2012-01-06 19:20:56 +0000
committerSteve Block <steveblock@google.com>2012-01-08 13:19:13 +0000
commit3762c311729fe9f3af085c14c5c1fb471d994c03 (patch)
tree7d4caccad80ac7327c7bff96dafc857d5f4631ad /cmds
parent7a939077bd14521c7d351af98df7ed75a8ec9c15 (diff)
downloadframeworks_base-3762c311729fe9f3af085c14c5c1fb471d994c03.zip
frameworks_base-3762c311729fe9f3af085c14c5c1fb471d994c03.tar.gz
frameworks_base-3762c311729fe9f3af085c14c5c1fb471d994c03.tar.bz2
Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
Diffstat (limited to 'cmds')
-rw-r--r--cmds/app_process/app_main.cpp2
-rw-r--r--cmds/bootanimation/BootAnimation.cpp4
-rw-r--r--cmds/dumpstate/dumpstate.c10
-rw-r--r--cmds/dumpsys/dumpsys.cpp2
-rw-r--r--cmds/installd/commands.c94
-rw-r--r--cmds/installd/installd.c30
-rw-r--r--cmds/installd/utils.c44
-rw-r--r--cmds/ip-up-vpn/ip-up-vpn.c16
-rw-r--r--cmds/keystore/keystore.cpp10
-rw-r--r--cmds/screenshot/screenshot.c12
-rw-r--r--cmds/servicemanager/binder.c12
-rw-r--r--cmds/servicemanager/service_manager.c12
-rw-r--r--cmds/stagefright/sf2.cpp2
13 files changed, 125 insertions, 125 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index 12d1669..6fe358c 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -72,7 +72,7 @@ public:
char* slashClassName = toSlashClassName(mClassName);
mClass = env->FindClass(slashClassName);
if (mClass == NULL) {
- LOGE("ERROR: could not find class '%s'\n", mClassName);
+ ALOGE("ERROR: could not find class '%s'\n", mClassName);
}
free(slashClassName);
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index f250367..0d5b4ca 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -69,7 +69,7 @@ BootAnimation::~BootAnimation() {
void BootAnimation::onFirstRef() {
status_t err = mSession->linkToComposerDeath(this);
- LOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err));
+ ALOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err));
if (err == NO_ERROR) {
run("BootAnimation", PRIORITY_DISPLAY);
}
@@ -374,7 +374,7 @@ bool BootAnimation::movie()
size_t numEntries = zip.getNumEntries();
ZipEntryRO desc = zip.findEntryByName("desc.txt");
FileMap* descMap = zip.createEntryFileMap(desc);
- LOGE_IF(!descMap, "descMap is null");
+ ALOGE_IF(!descMap, "descMap is null");
if (!descMap) {
return false;
}
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index fa06582..83c881a 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -329,22 +329,22 @@ int main(int argc, char *argv[]) {
if (getuid() == 0) {
if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
- LOGE("prctl(PR_SET_KEEPCAPS) failed: %s\n", strerror(errno));
+ ALOGE("prctl(PR_SET_KEEPCAPS) failed: %s\n", strerror(errno));
return -1;
}
/* switch to non-root user and group */
gid_t groups[] = { AID_LOG, AID_SDCARD_RW, AID_MOUNT, AID_INET };
if (setgroups(sizeof(groups)/sizeof(groups[0]), groups) != 0) {
- LOGE("Unable to setgroups, aborting: %s\n", strerror(errno));
+ ALOGE("Unable to setgroups, aborting: %s\n", strerror(errno));
return -1;
}
if (setgid(AID_SHELL) != 0) {
- LOGE("Unable to setgid, aborting: %s\n", strerror(errno));
+ ALOGE("Unable to setgid, aborting: %s\n", strerror(errno));
return -1;
}
if (setuid(AID_SHELL) != 0) {
- LOGE("Unable to setuid, aborting: %s\n", strerror(errno));
+ ALOGE("Unable to setuid, aborting: %s\n", strerror(errno));
return -1;
}
@@ -361,7 +361,7 @@ int main(int argc, char *argv[]) {
capdata[1].inheritable = 0;
if (capset(&capheader, &capdata[0]) < 0) {
- LOGE("capset failed: %s\n", strerror(errno));
+ ALOGE("capset failed: %s\n", strerror(errno));
return -1;
}
}
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp
index fdc5d5d..7dad6b6 100644
--- a/cmds/dumpsys/dumpsys.cpp
+++ b/cmds/dumpsys/dumpsys.cpp
@@ -31,7 +31,7 @@ int main(int argc, char* const argv[])
sp<IServiceManager> sm = defaultServiceManager();
fflush(stdout);
if (sm == NULL) {
- LOGE("Unable to get default service manager!");
+ ALOGE("Unable to get default service manager!");
aerr << "dumpsys: Unable to get default service manager!" << endl;
return 20;
}
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 4d80296..dd92bbe 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -30,47 +30,47 @@ int install(const char *pkgname, uid_t uid, gid_t gid)
char libdir[PKG_PATH_MAX];
if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) {
- LOGE("invalid uid/gid: %d %d\n", uid, gid);
+ ALOGE("invalid uid/gid: %d %d\n", uid, gid);
return -1;
}
if (create_pkg_path(pkgdir, pkgname, PKG_DIR_POSTFIX, 0)) {
- LOGE("cannot create package path\n");
+ ALOGE("cannot create package path\n");
return -1;
}
if (create_pkg_path(libdir, pkgname, PKG_LIB_POSTFIX, 0)) {
- LOGE("cannot create package lib path\n");
+ ALOGE("cannot create package lib path\n");
return -1;
}
if (mkdir(pkgdir, 0751) < 0) {
- LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
+ ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
return -errno;
}
if (chmod(pkgdir, 0751) < 0) {
- LOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
+ ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
unlink(pkgdir);
return -errno;
}
if (chown(pkgdir, uid, gid) < 0) {
- LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
+ ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
unlink(pkgdir);
return -errno;
}
if (mkdir(libdir, 0755) < 0) {
- LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
+ ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
unlink(pkgdir);
return -errno;
}
if (chmod(libdir, 0755) < 0) {
- LOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno));
+ ALOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno));
unlink(libdir);
unlink(pkgdir);
return -errno;
}
if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
- LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
+ ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
unlink(libdir);
unlink(pkgdir);
return -errno;
@@ -100,7 +100,7 @@ int renamepkg(const char *oldpkgname, const char *newpkgname)
return -1;
if (rename(oldpkgdir, newpkgdir) < 0) {
- LOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno));
+ ALOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno));
return -errno;
}
return 0;
@@ -127,11 +127,11 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona)
return -1;
}
if (mkdir(pkgdir, 0751) < 0) {
- LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
+ ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
return -errno;
}
if (chown(pkgdir, uid, uid) < 0) {
- LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
+ ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
unlink(pkgdir);
return -errno;
}
@@ -165,7 +165,7 @@ static int64_t disk_free()
if (statfs(android_data_dir.path, &sfs) == 0) {
return sfs.f_bavail * sfs.f_bsize;
} else {
- LOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno));
+ ALOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno));
return -1;
}
}
@@ -193,13 +193,13 @@ int free_cache(int64_t free_size)
if (avail >= free_size) return 0;
if (create_persona_path(datadir, 0)) {
- LOGE("couldn't get directory for persona 0");
+ ALOGE("couldn't get directory for persona 0");
return -1;
}
d = opendir(datadir);
if (d == NULL) {
- LOGE("cannot open %s: %s\n", datadir, strerror(errno));
+ ALOGE("cannot open %s: %s\n", datadir, strerror(errno));
return -1;
}
dfd = dirfd(d);
@@ -245,7 +245,7 @@ int move_dex(const char *src, const char *dst)
ALOGV("move %s -> %s\n", src_dex, dst_dex);
if (rename(src_dex, dst_dex) < 0) {
- LOGE("Couldn't move %s: %s\n", src_dex, strerror(errno));
+ ALOGE("Couldn't move %s: %s\n", src_dex, strerror(errno));
return -1;
} else {
return 0;
@@ -261,7 +261,7 @@ int rm_dex(const char *path)
ALOGV("unlink %s\n", dex_path);
if (unlink(dex_path) < 0) {
- LOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno));
+ ALOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno));
return -1;
} else {
return 0;
@@ -281,12 +281,12 @@ int protect(char *pkgname, gid_t gid)
if (stat(pkgpath, &s) < 0) return -1;
if (chown(pkgpath, s.st_uid, gid) < 0) {
- LOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno));
+ ALOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno));
return -1;
}
if (chmod(pkgpath, S_IRUSR|S_IWUSR|S_IRGRP) < 0) {
- LOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno));
+ ALOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno));
return -1;
}
@@ -443,7 +443,7 @@ static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name,
execl(DEX_OPT_BIN, DEX_OPT_BIN, "--zip", zip_num, odex_num, input_file_name,
dexopt_flags, (char*) NULL);
- LOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno));
+ ALOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno));
}
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)
zip_fd = open(apk_path, O_RDONLY, 0);
if (zip_fd < 0) {
- LOGE("dexopt cannot open '%s' for input\n", apk_path);
+ ALOGE("dexopt cannot open '%s' for input\n", apk_path);
return -1;
}
unlink(dex_path);
odex_fd = open(dex_path, O_RDWR | O_CREAT | O_EXCL, 0644);
if (odex_fd < 0) {
- LOGE("dexopt cannot open '%s' for output\n", dex_path);
+ ALOGE("dexopt cannot open '%s' for output\n", dex_path);
goto fail;
}
if (fchown(odex_fd, AID_SYSTEM, uid) < 0) {
- LOGE("dexopt cannot chown '%s'\n", dex_path);
+ ALOGE("dexopt cannot chown '%s'\n", dex_path);
goto fail;
}
if (fchmod(odex_fd,
S_IRUSR|S_IWUSR|S_IRGRP |
(is_public ? S_IROTH : 0)) < 0) {
- LOGE("dexopt cannot chmod '%s'\n", dex_path);
+ ALOGE("dexopt cannot chmod '%s'\n", dex_path);
goto fail;
}
@@ -543,15 +543,15 @@ int dexopt(const char *apk_path, uid_t uid, int is_public)
if (pid == 0) {
/* child -- drop privileges before continuing */
if (setgid(uid) != 0) {
- LOGE("setgid(%d) failed during dexopt\n", uid);
+ ALOGE("setgid(%d) failed during dexopt\n", uid);
exit(64);
}
if (setuid(uid) != 0) {
- LOGE("setuid(%d) during dexopt\n", uid);
+ ALOGE("setuid(%d) during dexopt\n", uid);
exit(65);
}
if (flock(odex_fd, LOCK_EX | LOCK_NB) != 0) {
- LOGE("flock(%s) failed: %s\n", dex_path, strerror(errno));
+ ALOGE("flock(%s) failed: %s\n", dex_path, strerror(errno));
exit(66);
}
@@ -560,7 +560,7 @@ int dexopt(const char *apk_path, uid_t uid, int is_public)
} else {
res = wait_dexopt(pid, apk_path);
if (res != 0) {
- LOGE("dexopt failed on '%s' res = %d\n", dex_path, res);
+ ALOGE("dexopt failed on '%s' res = %d\n", dex_path, res);
goto fail;
}
}
@@ -626,7 +626,7 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos,
ALOGV("Renaming %s to %s (uid %d)\n", srcpath, dstpath, dstuid);
if (rename(srcpath, dstpath) >= 0) {
if (chown(dstpath, dstuid, dstgid) < 0) {
- LOGE("cannot chown %s: %s\n", dstpath, strerror(errno));
+ ALOGE("cannot chown %s: %s\n", dstpath, strerror(errno));
unlink(dstpath);
return 1;
}
@@ -852,30 +852,30 @@ int linklib(const char* dataDir, const char* asecLibDir)
const size_t libdirLen = strlen(dataDir) + strlen(PKG_LIB_POSTFIX);
if (libdirLen >= PKG_PATH_MAX) {
- LOGE("library dir len too large");
+ ALOGE("library dir len too large");
return -1;
}
if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) {
- LOGE("library dir not written successfully: %s\n", strerror(errno));
+ ALOGE("library dir not written successfully: %s\n", strerror(errno));
return -1;
}
if (stat(dataDir, &s) < 0) return -1;
if (chown(dataDir, 0, 0) < 0) {
- LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
return -1;
}
if (chmod(dataDir, 0700) < 0) {
- LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
rc = -1;
goto out;
}
if (lstat(libdir, &libStat) < 0) {
- LOGE("couldn't stat lib dir: %s\n", strerror(errno));
+ ALOGE("couldn't stat lib dir: %s\n", strerror(errno));
rc = -1;
goto out;
}
@@ -893,13 +893,13 @@ int linklib(const char* dataDir, const char* asecLibDir)
}
if (symlink(asecLibDir, libdir) < 0) {
- LOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno));
+ ALOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno));
rc = -errno;
goto out;
}
if (lchown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
- LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
+ ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
unlink(libdir);
rc = -errno;
goto out;
@@ -907,12 +907,12 @@ int linklib(const char* dataDir, const char* asecLibDir)
out:
if (chmod(dataDir, s.st_mode) < 0) {
- LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
return -errno;
}
if (chown(dataDir, s.st_uid, s.st_gid) < 0) {
- LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
return -errno;
}
@@ -931,28 +931,28 @@ int unlinklib(const char* dataDir)
}
if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) {
- LOGE("library dir not written successfully: %s\n", strerror(errno));
+ ALOGE("library dir not written successfully: %s\n", strerror(errno));
return -1;
}
if (stat(dataDir, &s) < 0) {
- LOGE("couldn't state data dir");
+ ALOGE("couldn't state data dir");
return -1;
}
if (chown(dataDir, 0, 0) < 0) {
- LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno));
return -1;
}
if (chmod(dataDir, 0700) < 0) {
- LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
rc = -1;
goto out;
}
if (lstat(libdir, &libStat) < 0) {
- LOGE("couldn't stat lib dir: %s\n", strerror(errno));
+ ALOGE("couldn't stat lib dir: %s\n", strerror(errno));
rc = -1;
goto out;
}
@@ -970,13 +970,13 @@ int unlinklib(const char* dataDir)
}
if (mkdir(libdir, 0755) < 0) {
- LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
+ ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
rc = -errno;
goto out;
}
if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
- LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
+ ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
unlink(libdir);
rc = -errno;
goto out;
@@ -984,12 +984,12 @@ int unlinklib(const char* dataDir)
out:
if (chmod(dataDir, s.st_mode) < 0) {
- LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno));
return -1;
}
if (chown(dataDir, s.st_uid, s.st_gid) < 0) {
- LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
+ ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno));
return -1;
}
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 159bccb..569b491 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -157,11 +157,11 @@ static int readx(int s, void *_buf, int count)
r = read(s, buf + n, count - n);
if (r < 0) {
if (errno == EINTR) continue;
- LOGE("read error: %s\n", strerror(errno));
+ ALOGE("read error: %s\n", strerror(errno));
return -1;
}
if (r == 0) {
- LOGE("eof\n");
+ ALOGE("eof\n");
return -1; /* EOF */
}
n += r;
@@ -178,7 +178,7 @@ static int writex(int s, const void *_buf, int count)
r = write(s, buf + n, count - n);
if (r < 0) {
if (errno == EINTR) continue;
- LOGE("write error: %s\n", strerror(errno));
+ ALOGE("write error: %s\n", strerror(errno));
return -1;
}
n += r;
@@ -213,7 +213,7 @@ static int execute(int s, char cmd[BUFFER_MAX])
n++;
arg[n] = cmd;
if (n == TOKEN_MAX) {
- LOGE("too many arguments\n");
+ ALOGE("too many arguments\n");
goto done;
}
}
@@ -223,7 +223,7 @@ static int execute(int s, char cmd[BUFFER_MAX])
for (i = 0; i < sizeof(cmds) / sizeof(cmds[0]); i++) {
if (!strcmp(cmds[i].name,arg[0])) {
if (n != cmds[i].numargs) {
- LOGE("%s requires %d arguments (%d given)\n",
+ ALOGE("%s requires %d arguments (%d given)\n",
cmds[i].name, cmds[i].numargs, n);
} else {
ret = cmds[i].func(arg + 1, reply);
@@ -231,7 +231,7 @@ static int execute(int s, char cmd[BUFFER_MAX])
goto done;
}
}
- LOGE("unsupported command '%s'\n", arg[0]);
+ ALOGE("unsupported command '%s'\n", arg[0]);
done:
if (reply[0]) {
@@ -290,7 +290,7 @@ int initialize_globals() {
android_system_dirs.dirs = calloc(android_system_dirs.count, sizeof(dir_rec_t));
if (android_system_dirs.dirs == NULL) {
- LOGE("Couldn't allocate array for dirs; aborting\n");
+ ALOGE("Couldn't allocate array for dirs; aborting\n");
return -1;
}
@@ -351,22 +351,22 @@ int main(const int argc, const char *argv[]) {
int lsocket, s, count;
if (initialize_globals() < 0) {
- LOGE("Could not initialize globals; exiting.\n");
+ ALOGE("Could not initialize globals; exiting.\n");
exit(1);
}
if (initialize_directories() < 0) {
- LOGE("Could not create directories; exiting.\n");
+ ALOGE("Could not create directories; exiting.\n");
exit(1);
}
lsocket = android_get_control_socket(SOCKET_PATH);
if (lsocket < 0) {
- LOGE("Failed to get socket from environment: %s\n", strerror(errno));
+ ALOGE("Failed to get socket from environment: %s\n", strerror(errno));
exit(1);
}
if (listen(lsocket, 5)) {
- LOGE("Listen on socket failed: %s\n", strerror(errno));
+ ALOGE("Listen on socket failed: %s\n", strerror(errno));
exit(1);
}
fcntl(lsocket, F_SETFD, FD_CLOEXEC);
@@ -375,7 +375,7 @@ int main(const int argc, const char *argv[]) {
alen = sizeof(addr);
s = accept(lsocket, &addr, &alen);
if (s < 0) {
- LOGE("Accept failed: %s\n", strerror(errno));
+ ALOGE("Accept failed: %s\n", strerror(errno));
continue;
}
fcntl(s, F_SETFD, FD_CLOEXEC);
@@ -384,15 +384,15 @@ int main(const int argc, const char *argv[]) {
for (;;) {
unsigned short count;
if (readx(s, &count, sizeof(count))) {
- LOGE("failed to read size\n");
+ ALOGE("failed to read size\n");
break;
}
if ((count < 1) || (count >= BUFFER_MAX)) {
- LOGE("invalid size %d\n", count);
+ ALOGE("invalid size %d\n", count);
break;
}
if (readx(s, buf, count)) {
- LOGE("failed to read command\n");
+ ALOGE("failed to read command\n");
break;
}
buf[count] = 0;
diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c
index 940626e..52ec9e8 100644
--- a/cmds/installd/utils.c
+++ b/cmds/installd/utils.c
@@ -42,7 +42,7 @@ int create_pkg_path_in_dir(char path[PKG_PATH_MAX],
if (append_and_increment(&dst, dir->path, &dst_size) < 0
|| append_and_increment(&dst, pkgname, &dst_size) < 0
|| append_and_increment(&dst, postfix, &dst_size) < 0) {
- LOGE("Error building APK path");
+ ALOGE("Error building APK path");
return -1;
}
@@ -76,7 +76,7 @@ int create_pkg_path(char path[PKG_PATH_MAX],
if (append_and_increment(&dst, android_data_dir.path, &dst_size) < 0
|| append_and_increment(&dst, persona_prefix, &dst_size) < 0) {
- LOGE("Error building prefix for APK path");
+ ALOGE("Error building prefix for APK path");
return -1;
}
@@ -117,18 +117,18 @@ int create_persona_path(char path[PKG_PATH_MAX],
if (append_and_increment(&dst, android_data_dir.path, &dst_size) < 0
|| append_and_increment(&dst, persona_prefix, &dst_size) < 0) {
- LOGE("Error building prefix for user path");
+ ALOGE("Error building prefix for user path");
return -1;
}
if (persona != 0) {
if (dst_size < uid_len + 1) {
- LOGE("Error building user path");
+ ALOGE("Error building user path");
return -1;
}
int ret = snprintf(dst, dst_size, "%d/", persona);
if (ret < 0 || (size_t) ret != uid_len) {
- LOGE("Error appending persona id to path");
+ ALOGE("Error appending persona id to path");
return -1;
}
}
@@ -163,7 +163,7 @@ int is_valid_package_name(const char* pkgname) {
} else if (*x == '.') {
if ((x == pkgname) || (x[1] == '.') || (x[1] == 0)) {
/* periods must not be first, last, or doubled */
- LOGE("invalid package name '%s'\n", pkgname);
+ ALOGE("invalid package name '%s'\n", pkgname);
return -1;
}
} else if (*x == '-') {
@@ -172,7 +172,7 @@ int is_valid_package_name(const char* pkgname) {
alpha = 1;
} else {
/* anything not A-Z, a-z, 0-9, _, or . is invalid */
- LOGE("invalid package name '%s'\n", pkgname);
+ ALOGE("invalid package name '%s'\n", pkgname);
return -1;
}
@@ -184,7 +184,7 @@ int is_valid_package_name(const char* pkgname) {
x++;
while (*x) {
if (!isalnum(*x)) {
- LOGE("invalid package name '%s' should include only numbers after -\n", pkgname);
+ ALOGE("invalid package name '%s' should include only numbers after -\n", pkgname);
return -1;
}
x++;
@@ -222,13 +222,13 @@ static int _delete_dir_contents(DIR *d, const char *ignore)
subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY);
if (subfd < 0) {
- LOGE("Couldn't openat %s: %s\n", name, strerror(errno));
+ ALOGE("Couldn't openat %s: %s\n", name, strerror(errno));
result = -1;
continue;
}
subdir = fdopendir(subfd);
if (subdir == NULL) {
- LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno));
+ ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno));
close(subfd);
result = -1;
continue;
@@ -238,12 +238,12 @@ static int _delete_dir_contents(DIR *d, const char *ignore)
}
closedir(subdir);
if (unlinkat(dfd, name, AT_REMOVEDIR) < 0) {
- LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno));
+ ALOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno));
result = -1;
}
} else {
if (unlinkat(dfd, name, 0) < 0) {
- LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno));
+ ALOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno));
result = -1;
}
}
@@ -261,14 +261,14 @@ int delete_dir_contents(const char *pathname,
d = opendir(pathname);
if (d == NULL) {
- LOGE("Couldn't opendir %s: %s\n", pathname, strerror(errno));
+ ALOGE("Couldn't opendir %s: %s\n", pathname, strerror(errno));
return -errno;
}
res = _delete_dir_contents(d, ignore);
closedir(d);
if (also_delete_dir) {
if (rmdir(pathname)) {
- LOGE("Couldn't rmdir %s: %s\n", pathname, strerror(errno));
+ ALOGE("Couldn't rmdir %s: %s\n", pathname, strerror(errno));
res = -1;
}
}
@@ -282,12 +282,12 @@ int delete_dir_contents_fd(int dfd, const char *name)
fd = openat(dfd, name, O_RDONLY | O_DIRECTORY);
if (fd < 0) {
- LOGE("Couldn't openat %s: %s\n", name, strerror(errno));
+ ALOGE("Couldn't openat %s: %s\n", name, strerror(errno));
return -1;
}
d = fdopendir(fd);
if (d == NULL) {
- LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno));
+ ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno));
close(fd);
return -1;
}
@@ -307,7 +307,7 @@ int validate_system_app_path(const char* path) {
const size_t dir_len = android_system_dirs.dirs[i].len;
if (!strncmp(path, android_system_dirs.dirs[i].path, dir_len)) {
if (path[dir_len] == '.' || strchr(path + dir_len, '/') != NULL) {
- LOGE("invalid system apk path '%s' (trickery)\n", path);
+ ALOGE("invalid system apk path '%s' (trickery)\n", path);
return -1;
}
return 0;
@@ -377,7 +377,7 @@ int get_path_from_string(dir_rec_t* rec, const char* path) {
if (append_and_increment(&dst, path, &dst_size) < 0
|| append_and_increment(&dst, "/", &dst_size)) {
- LOGE("Error canonicalizing path");
+ ALOGE("Error canonicalizing path");
return -1;
}
@@ -395,7 +395,7 @@ int copy_and_append(dir_rec_t* dst, const dir_rec_t* src, const char* suffix) {
if (dst->path == NULL
|| snprintf(dst->path, dstSize, "%s%s", src->path, suffix)
!= (ssize_t) dst->len) {
- LOGE("Could not allocate memory to hold appended path; aborting\n");
+ ALOGE("Could not allocate memory to hold appended path; aborting\n");
return -1;
}
@@ -422,7 +422,7 @@ int validate_apk_path(const char *path)
dir_len = android_asec_dir.len;
allowsubdir = 1;
} else {
- LOGE("invalid apk path '%s' (bad prefix)\n", path);
+ ALOGE("invalid apk path '%s' (bad prefix)\n", path);
return -1;
}
@@ -435,7 +435,7 @@ int validate_apk_path(const char *path)
++subdir;
if (!allowsubdir
|| (path_len > (size_t) (subdir - path) && (strchr(subdir, '/') != NULL))) {
- LOGE("invalid apk path '%s' (subdir?)\n", path);
+ ALOGE("invalid apk path '%s' (subdir?)\n", path);
return -1;
}
}
@@ -446,7 +446,7 @@ int validate_apk_path(const char *path)
*/
if (path[dir_len] == '.'
|| (subdir != NULL && ((*subdir == '.') || (strchr(subdir, '/') != NULL)))) {
- LOGE("invalid apk path '%s' (trickery)\n", path);
+ ALOGE("invalid apk path '%s' (trickery)\n", path);
return -1;
}
diff --git a/cmds/ip-up-vpn/ip-up-vpn.c b/cmds/ip-up-vpn/ip-up-vpn.c
index 0e6286f..9fcc950 100644
--- a/cmds/ip-up-vpn/ip-up-vpn.c
+++ b/cmds/ip-up-vpn/ip-up-vpn.c
@@ -67,7 +67,7 @@ int main(int argc, char **argv)
{
FILE *state = fopen(DIR ".tmp", "wb");
if (!state) {
- LOGE("Cannot create state: %s", strerror(errno));
+ ALOGE("Cannot create state: %s", strerror(errno));
return 1;
}
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
while (!ioctl(s, SIOCDELRT, &rt));
}
if (errno != ESRCH) {
- LOGE("Cannot remove host route: %s", strerror(errno));
+ ALOGE("Cannot remove host route: %s", strerror(errno));
return 1;
}
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
rt.rt_flags |= RTF_GATEWAY;
if (!set_address(&rt.rt_gateway, argv[1]) ||
(ioctl(s, SIOCADDRT, &rt) && errno != EEXIST)) {
- LOGE("Cannot create host route: %s", strerror(errno));
+ ALOGE("Cannot create host route: %s", strerror(errno));
return 1;
}
@@ -113,21 +113,21 @@ int main(int argc, char **argv)
ifr.ifr_flags = IFF_UP;
strncpy(ifr.ifr_name, interface, IFNAMSIZ);
if (ioctl(s, SIOCSIFFLAGS, &ifr)) {
- LOGE("Cannot bring up %s: %s", interface, strerror(errno));
+ ALOGE("Cannot bring up %s: %s", interface, strerror(errno));
return 1;
}
/* Set the address. */
if (!set_address(&ifr.ifr_addr, address) ||
ioctl(s, SIOCSIFADDR, &ifr)) {
- LOGE("Cannot set address: %s", strerror(errno));
+ ALOGE("Cannot set address: %s", strerror(errno));
return 1;
}
/* Set the netmask. */
if (set_address(&ifr.ifr_netmask, env("INTERNAL_NETMASK4"))) {
if (ioctl(s, SIOCSIFNETMASK, &ifr)) {
- LOGE("Cannot set netmask: %s", strerror(errno));
+ ALOGE("Cannot set netmask: %s", strerror(errno));
return 1;
}
}
@@ -140,13 +140,13 @@ int main(int argc, char **argv)
fprintf(state, "%s\n", env("INTERNAL_DNS4_LIST"));
fprintf(state, "%s\n", env("DEFAULT_DOMAIN"));
} else {
- LOGE("Cannot parse parameters");
+ ALOGE("Cannot parse parameters");
return 1;
}
fclose(state);
if (chmod(DIR ".tmp", 0444) || rename(DIR ".tmp", DIR "state")) {
- LOGE("Cannot write state: %s", strerror(errno));
+ ALOGE("Cannot write state: %s", strerror(errno));
return 1;
}
return 0;
diff --git a/cmds/keystore/keystore.cpp b/cmds/keystore/keystore.cpp
index 6ca31a6..05f77e5 100644
--- a/cmds/keystore/keystore.cpp
+++ b/cmds/keystore/keystore.cpp
@@ -133,7 +133,7 @@ public:
const char* randomDevice = "/dev/urandom";
mRandom = ::open(randomDevice, O_RDONLY);
if (mRandom == -1) {
- LOGE("open: %s: %s", randomDevice, strerror(errno));
+ ALOGE("open: %s: %s", randomDevice, strerror(errno));
return false;
}
return true;
@@ -754,11 +754,11 @@ static ResponseCode process(KeyStore* keyStore, int sock, uid_t uid, int8_t code
int main(int argc, char* argv[]) {
int controlSocket = android_get_control_socket("keystore");
if (argc < 2) {
- LOGE("A directory must be specified!");
+ ALOGE("A directory must be specified!");
return 1;
}
if (chdir(argv[1]) == -1) {
- LOGE("chdir: %s: %s", argv[1], strerror(errno));
+ ALOGE("chdir: %s: %s", argv[1], strerror(errno));
return 1;
}
@@ -767,7 +767,7 @@ int main(int argc, char* argv[]) {
return 1;
}
if (listen(controlSocket, 3) == -1) {
- LOGE("listen: %s", strerror(errno));
+ ALOGE("listen: %s", strerror(errno));
return 1;
}
@@ -805,6 +805,6 @@ int main(int argc, char* argv[]) {
}
close(sock);
}
- LOGE("accept: %s", strerror(errno));
+ ALOGE("accept: %s", strerror(errno));
return 1;
}
diff --git a/cmds/screenshot/screenshot.c b/cmds/screenshot/screenshot.c
index 048636c..cca80c3 100644
--- a/cmds/screenshot/screenshot.c
+++ b/cmds/screenshot/screenshot.c
@@ -26,20 +26,20 @@ void take_screenshot(FILE *fb_in, FILE *fb_out) {
fb = fileno(fb_in);
if(fb < 0) {
- LOGE("failed to open framebuffer\n");
+ ALOGE("failed to open framebuffer\n");
return;
}
fb_in = fdopen(fb, "r");
if(ioctl(fb, FBIOGET_VSCREENINFO, &vinfo) < 0) {
- LOGE("failed to get framebuffer info\n");
+ ALOGE("failed to get framebuffer info\n");
return;
}
fcntl(fb, F_SETFD, FD_CLOEXEC);
png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png == NULL) {
- LOGE("failed png_create_write_struct\n");
+ ALOGE("failed png_create_write_struct\n");
fclose(fb_in);
return;
}
@@ -47,13 +47,13 @@ void take_screenshot(FILE *fb_in, FILE *fb_out) {
png_init_io(png, fb_out);
info = png_create_info_struct(png);
if (info == NULL) {
- LOGE("failed png_create_info_struct\n");
+ ALOGE("failed png_create_info_struct\n");
png_destroy_write_struct(&png, NULL);
fclose(fb_in);
return;
}
if (setjmp(png_jmpbuf(png))) {
- LOGE("failed png setjmp\n");
+ ALOGE("failed png setjmp\n");
png_destroy_write_struct(&png, NULL);
fclose(fb_in);
return;
@@ -68,7 +68,7 @@ void take_screenshot(FILE *fb_in, FILE *fb_out) {
rowlen=vinfo.xres * bytespp;
if (rowlen > sizeof(imgbuf)) {
- LOGE("crazy rowlen: %d\n", rowlen);
+ ALOGE("crazy rowlen: %d\n", rowlen);
png_destroy_write_struct(&png, NULL);
fclose(fb_in);
return;
diff --git a/cmds/servicemanager/binder.c b/cmds/servicemanager/binder.c
index b03b620..918d4d4 100644
--- a/cmds/servicemanager/binder.c
+++ b/cmds/servicemanager/binder.c
@@ -219,7 +219,7 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio,
case BR_TRANSACTION: {
struct binder_txn *txn = (void *) ptr;
if ((end - ptr) * sizeof(uint32_t) < sizeof(struct binder_txn)) {
- LOGE("parse: txn too small!\n");
+ ALOGE("parse: txn too small!\n");
return -1;
}
binder_dump_txn(txn);
@@ -240,7 +240,7 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio,
case BR_REPLY: {
struct binder_txn *txn = (void*) ptr;
if ((end - ptr) * sizeof(uint32_t) < sizeof(struct binder_txn)) {
- LOGE("parse: reply too small!\n");
+ ALOGE("parse: reply too small!\n");
return -1;
}
binder_dump_txn(txn);
@@ -266,7 +266,7 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio,
r = -1;
break;
default:
- LOGE("parse: OOPS %d\n", cmd);
+ ALOGE("parse: OOPS %d\n", cmd);
return -1;
}
}
@@ -375,17 +375,17 @@ void binder_loop(struct binder_state *bs, binder_handler func)
res = ioctl(bs->fd, BINDER_WRITE_READ, &bwr);
if (res < 0) {
- LOGE("binder_loop: ioctl failed (%s)\n", strerror(errno));
+ ALOGE("binder_loop: ioctl failed (%s)\n", strerror(errno));
break;
}
res = binder_parse(bs, 0, readbuf, bwr.read_consumed, func);
if (res == 0) {
- LOGE("binder_loop: unexpected reply?!\n");
+ ALOGE("binder_loop: unexpected reply?!\n");
break;
}
if (res < 0) {
- LOGE("binder_loop: io error %d %s\n", res, strerror(errno));
+ ALOGE("binder_loop: io error %d %s\n", res, strerror(errno));
break;
}
}
diff --git a/cmds/servicemanager/service_manager.c b/cmds/servicemanager/service_manager.c
index 6ad114a..42d8977 100644
--- a/cmds/servicemanager/service_manager.c
+++ b/cmds/servicemanager/service_manager.c
@@ -12,7 +12,7 @@
#if 0
#define ALOGI(x...) fprintf(stderr, "svcmgr: " x)
-#define LOGE(x...) fprintf(stderr, "svcmgr: " x)
+#define ALOGE(x...) fprintf(stderr, "svcmgr: " x)
#else
#define LOG_TAG "ServiceManager"
#include <cutils/log.h>
@@ -152,7 +152,7 @@ int do_add_service(struct binder_state *bs,
return -1;
if (!svc_can_register(uid, s)) {
- LOGE("add_service('%s',%p) uid=%d - PERMISSION DENIED\n",
+ ALOGE("add_service('%s',%p) uid=%d - PERMISSION DENIED\n",
str8(s), ptr, uid);
return -1;
}
@@ -160,7 +160,7 @@ int do_add_service(struct binder_state *bs,
si = find_svc(s, len);
if (si) {
if (si->ptr) {
- LOGE("add_service('%s',%p) uid=%d - ALREADY REGISTERED, OVERRIDE\n",
+ ALOGE("add_service('%s',%p) uid=%d - ALREADY REGISTERED, OVERRIDE\n",
str8(s), ptr, uid);
svcinfo_death(bs, si);
}
@@ -168,7 +168,7 @@ int do_add_service(struct binder_state *bs,
} else {
si = malloc(sizeof(*si) + (len + 1) * sizeof(uint16_t));
if (!si) {
- LOGE("add_service('%s',%p) uid=%d - OUT OF MEMORY\n",
+ ALOGE("add_service('%s',%p) uid=%d - OUT OF MEMORY\n",
str8(s), ptr, uid);
return -1;
}
@@ -246,7 +246,7 @@ int svcmgr_handler(struct binder_state *bs,
return -1;
}
default:
- LOGE("unknown code %d\n", txn->code);
+ ALOGE("unknown code %d\n", txn->code);
return -1;
}
@@ -262,7 +262,7 @@ int main(int argc, char **argv)
bs = binder_open(128*1024);
if (binder_become_context_manager(bs)) {
- LOGE("cannot become context manager (%s)\n", strerror(errno));
+ ALOGE("cannot become context manager (%s)\n", strerror(errno));
return -1;
}
diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp
index 7551d31..ae80f88 100644
--- a/cmds/stagefright/sf2.cpp
+++ b/cmds/stagefright/sf2.cpp
@@ -454,7 +454,7 @@ private:
if (sizeNeeded > sizeLeft) {
if (outBuffer->size() == 0) {
- LOGE("Unable to fit even a single input buffer of size %d.",
+ ALOGE("Unable to fit even a single input buffer of size %d.",
sizeNeeded);
}
CHECK_GT(outBuffer->size(), 0u);