Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: I1e070511b6a538e9f1c94657356437a457d58882
diff --git a/libcutils/loghack.h b/libcutils/loghack.h
index 8b357ca..330e1ee 100644
--- a/libcutils/loghack.h
+++ b/libcutils/loghack.h
@@ -30,7 +30,7 @@
#define ALOGV(...) ALOG("V", __VA_ARGS__)
#define ALOGD(...) ALOG("D", __VA_ARGS__)
#define ALOGI(...) ALOG("I", __VA_ARGS__)
-#define LOGW(...) ALOG("W", __VA_ARGS__)
+#define ALOGW(...) ALOG("W", __VA_ARGS__)
#define LOGE(...) ALOG("E", __VA_ARGS__)
#define LOG_ALWAYS_FATAL(...) do { LOGE(__VA_ARGS__); exit(1); } while (0)
#endif
diff --git a/libcutils/mq.c b/libcutils/mq.c
index 132debd..6f6740e 100644
--- a/libcutils/mq.c
+++ b/libcutils/mq.c
@@ -222,7 +222,7 @@
static void closeWithWarning(int fd) {
int result = close(fd);
if (result == -1) {
- LOGW("close() error: %s", strerror(errno));
+ ALOGW("close() error: %s", strerror(errno));
}
}
@@ -433,12 +433,12 @@
static void peerProxyHandleError(PeerProxy* peerProxy, char* functionName) {
if (errno == EINTR) {
// Log interruptions but otherwise ignore them.
- LOGW("%s() interrupted.", functionName);
+ ALOGW("%s() interrupted.", functionName);
} else if (errno == EAGAIN) {
ALOGD("EWOULDBLOCK");
// Ignore.
} else {
- LOGW("Error returned by %s().", functionName);
+ ALOGW("Error returned by %s().", functionName);
peerProxyKill(peerProxy, true);
}
}
@@ -583,7 +583,7 @@
peerProxy->inputState = READING_BYTES;
if (bufferPrepareForRead(peerProxy->inputBuffer, header->size) == -1) {
- LOGW("Couldn't allocate memory for incoming data. Size: %u",
+ ALOGW("Couldn't allocate memory for incoming data. Size: %u",
(unsigned int) header->size);
// TODO: Ignore the packet and log a warning?
@@ -670,7 +670,7 @@
// TODO: Restructure things so we don't need this check.
// Verify that this really is the master.
if (!masterProxy->master) {
- LOGW("Non-master process %d tried to send us a connection.",
+ ALOGW("Non-master process %d tried to send us a connection.",
masterProxy->credentials.pid);
// Kill off the evil peer.
peerProxyKill(masterProxy, false);
@@ -686,7 +686,7 @@
peerLock(localPeer);
PeerProxy* peerProxy = peerProxyGetOrCreate(localPeer, pid, false);
if (peerProxy == NULL) {
- LOGW("Peer proxy creation failed: %s", strerror(errno));
+ ALOGW("Peer proxy creation failed: %s", strerror(errno));
} else {
// Fill in full credentials.
peerProxy->credentials = header->credentials;
@@ -746,7 +746,7 @@
if (size < 0) {
if (errno == EINTR) {
// Log interruptions but otherwise ignore them.
- LOGW("recvmsg() interrupted.");
+ ALOGW("recvmsg() interrupted.");
return;
} else if (errno == EAGAIN) {
// Keep waiting for the connection.
@@ -777,14 +777,14 @@
// The peer proxy this connection is for.
PeerProxy* peerProxy = masterProxy->connecting;
if (peerProxy == NULL) {
- LOGW("Received connection for unknown peer.");
+ ALOGW("Received connection for unknown peer.");
closeWithWarning(incomingFd);
} else {
Peer* peer = masterProxy->peer;
SelectableFd* selectableFd = selectorAdd(peer->selector, incomingFd);
if (selectableFd == NULL) {
- LOGW("Error adding fd to selector for %d.",
+ ALOGW("Error adding fd to selector for %d.",
peerProxy->credentials.pid);
closeWithWarning(incomingFd);
peerProxyKill(peerProxy, false);
@@ -811,7 +811,7 @@
int sockets[2];
int result = socketpair(AF_LOCAL, SOCK_STREAM, 0, sockets);
if (result == -1) {
- LOGW("socketpair() error: %s", strerror(errno));
+ ALOGW("socketpair() error: %s", strerror(errno));
// TODO: Send CONNECTION_FAILED packets to peers.
return;
}
@@ -821,7 +821,7 @@
if (packetA == NULL || packetB == NULL) {
free(packetA);
free(packetB);
- LOGW("malloc() error. Failed to tell process %d that process %d is"
+ ALOGW("malloc() error. Failed to tell process %d that process %d is"
" dead.", peerA->credentials.pid, peerB->credentials.pid);
return;
}
@@ -852,7 +852,7 @@
Credentials credentials) {
OutgoingPacket* packet = calloc(1, sizeof(OutgoingPacket));
if (packet == NULL) {
- LOGW("malloc() error. Failed to tell process %d that process %d is"
+ ALOGW("malloc() error. Failed to tell process %d that process %d is"
" dead.", peerProxy->credentials.pid, credentials.pid);
return;
}
@@ -905,7 +905,7 @@
ALOGI("Couldn't connect to %d.", pid);
peerProxyKill(peerProxy, false);
} else {
- LOGW("Peer proxy for %d not found. This shouldn't happen.", pid);
+ ALOGW("Peer proxy for %d not found. This shouldn't happen.", pid);
}
peerProxyExpectHeader(masterProxy);
@@ -929,7 +929,7 @@
peerProxyExpectBytes(peerProxy, header);
break;
default:
- LOGW("Invalid packet type from %d: %d", peerProxy->credentials.pid,
+ ALOGW("Invalid packet type from %d: %d", peerProxy->credentials.pid,
header->type);
peerProxyKill(peerProxy, false);
}
@@ -1026,7 +1026,7 @@
// Accept connection.
int socket = accept(listenerFd->fd, NULL, NULL);
if (socket == -1) {
- LOGW("accept() error: %s", strerror(errno));
+ ALOGW("accept() error: %s", strerror(errno));
return;
}
@@ -1040,7 +1040,7 @@
&ucredentials, &credentialsSize);
// We might want to verify credentialsSize.
if (result == -1) {
- LOGW("getsockopt() error: %s", strerror(errno));
+ ALOGW("getsockopt() error: %s", strerror(errno));
closeWithWarning(socket);
return;
}
@@ -1061,7 +1061,7 @@
= hashmapGet(masterPeer->peerProxies, &credentials.pid);
if (peerProxy != NULL) {
peerUnlock(masterPeer);
- LOGW("Alread connected to process %d.", credentials.pid);
+ ALOGW("Alread connected to process %d.", credentials.pid);
closeWithWarning(socket);
return;
}
@@ -1070,7 +1070,7 @@
SelectableFd* socketFd = selectorAdd(masterPeer->selector, socket);
if (socketFd == NULL) {
peerUnlock(masterPeer);
- LOGW("malloc() failed.");
+ ALOGW("malloc() failed.");
closeWithWarning(socket);
return;
}
@@ -1079,7 +1079,7 @@
peerProxy = peerProxyCreate(masterPeer, credentials);
peerUnlock(masterPeer);
if (peerProxy == NULL) {
- LOGW("malloc() failed.");
+ ALOGW("malloc() failed.");
socketFd->remove = true;
closeWithWarning(socket);
}
diff --git a/libcutils/properties.c b/libcutils/properties.c
index 98dbf50..e29d261 100644
--- a/libcutils/properties.c
+++ b/libcutils/properties.c
@@ -99,7 +99,7 @@
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
- LOGW("UNIX domain socket create failed (errno=%d)\n", errno);
+ ALOGW("UNIX domain socket create failed (errno=%d)\n", errno);
return -1;
}
@@ -110,7 +110,7 @@
if (cc < 0) {
// ENOENT means socket file doesn't exist
// ECONNREFUSED means socket exists but nobody is listening
- //LOGW("AF_UNIX connect failed for '%s': %s\n",
+ //ALOGW("AF_UNIX connect failed for '%s': %s\n",
// fileName, strerror(errno));
close(sock);
return -1;
@@ -128,7 +128,7 @@
gPropFd = connectToServer(SYSTEM_PROPERTY_PIPE_NAME);
if (gPropFd < 0) {
- //LOGW("not connected to system property server\n");
+ //ALOGW("not connected to system property server\n");
} else {
//ALOGV("Connected to system property server\n");
}