summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Kong2018-07-13 19:39:22 -0500
committerYi Kong2018-07-13 19:50:55 -0500
commitc8d09ddceb6ed9771b100c36fe4ca81d6ee1cfb2 (patch)
tree96692c3a30c1e9237194294b55ec8fc6b2f1b71f /logd/LogListener.cpp
parentdc8483cc04ea9d2a716a4ba0916eb3941b54156c (diff)
downloadplatform-system-core-c8d09ddceb6ed9771b100c36fe4ca81d6ee1cfb2.tar.gz
platform-system-core-c8d09ddceb6ed9771b100c36fe4ca81d6ee1cfb2.tar.xz
platform-system-core-c8d09ddceb6ed9771b100c36fe4ca81d6ee1cfb2.zip
[logd] Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I15ccb9cfc9967dae4320d9690f5097bc2f7d5bfe
Diffstat (limited to 'logd/LogListener.cpp')
-rw-r--r--logd/LogListener.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index fc51dcf08..e568ddcf4 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -50,7 +50,7 @@ bool LogListener::onDataAvailable(SocketClient* cli) {
50 50
51 alignas(4) char control[CMSG_SPACE(sizeof(struct ucred))]; 51 alignas(4) char control[CMSG_SPACE(sizeof(struct ucred))];
52 struct msghdr hdr = { 52 struct msghdr hdr = {
53 NULL, 0, &iov, 1, control, sizeof(control), 0, 53 nullptr, 0, &iov, 1, control, sizeof(control), 0,
54 }; 54 };
55 55
56 int socket = cli->getSocket(); 56 int socket = cli->getSocket();
@@ -66,10 +66,10 @@ bool LogListener::onDataAvailable(SocketClient* cli) {
66 66
67 buffer[n] = 0; 67 buffer[n] = 0;
68 68
69 struct ucred* cred = NULL; 69 struct ucred* cred = nullptr;
70 70
71 struct cmsghdr* cmsg = CMSG_FIRSTHDR(&hdr); 71 struct cmsghdr* cmsg = CMSG_FIRSTHDR(&hdr);
72 while (cmsg != NULL) { 72 while (cmsg != nullptr) {
73 if (cmsg->cmsg_level == SOL_SOCKET && 73 if (cmsg->cmsg_level == SOL_SOCKET &&
74 cmsg->cmsg_type == SCM_CREDENTIALS) { 74 cmsg->cmsg_type == SCM_CREDENTIALS) {
75 cred = (struct ucred*)CMSG_DATA(cmsg); 75 cred = (struct ucred*)CMSG_DATA(cmsg);
@@ -79,7 +79,7 @@ bool LogListener::onDataAvailable(SocketClient* cli) {
79 } 79 }
80 80
81 struct ucred fake_cred; 81 struct ucred fake_cred;
82 if (cred == NULL) { 82 if (cred == nullptr) {
83 cred = &fake_cred; 83 cred = &fake_cred;
84 cred->pid = 0; 84 cred->pid = 0;
85 cred->uid = DEFAULT_OVERFLOWUID; 85 cred->uid = DEFAULT_OVERFLOWUID;