diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-11-23 00:21:14 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-11-23 00:21:14 +0000 |
commit | 0b34abc135d4f63e1b074604eff386b918d43af5 (patch) | |
tree | 41f1893200977ebfcf00b714f541b3e8bd85405d | |
parent | e7774409b8ec8ae7179ab2372e759808650f415e (diff) | |
parent | 7e86b8e3189f9719538a97952dff8ea1c6b67f8d (diff) | |
download | recovery-android-platform-11.0.0_r33.tar.gz |
Merge cherrypicks of [16034932] into rvc-platform-release.android-platform-11.0.0_r40android-platform-11.0.0_r39android-platform-11.0.0_r38android-platform-11.0.0_r37android-platform-11.0.0_r36android-platform-11.0.0_r35android-platform-11.0.0_r34android-platform-11.0.0_r33android-platform-11.0.0_r32android-platform-11.0.0_r31android-platform-11.0.0_r30android-platform-11.0.0_r29android-platform-11.0.0_r28android-platform-11.0.0_r27android-platform-11.0.0_r26android-platform-11.0.0_r25android-platform-11.0.0_r24android-platform-11.0.0_r23android-platform-11.0.0_r22android-platform-11.0.0_r21android-platform-11.0.0_r20android-platform-11.0.0_r19android-platform-11.0.0_r18android-platform-11.0.0_r17android-platform-11.0.0_r16android-platform-11.0.0_r15android-platform-11.0.0_r14android11-platform-release
Change-Id: I993978f286bcba93f425a92a0bc828bbf20b87b5
-rw-r--r-- | minui/events.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/minui/events.cpp b/minui/events.cpp index 87f81122..863ac747 100644 --- a/minui/events.cpp +++ b/minui/events.cpp @@ -29,7 +29,9 @@ #include <functional> #include <memory> +#include <string> +#include <android-base/strings.h> #include <android-base/unique_fd.h> #include "minui/minui.h" @@ -118,12 +120,12 @@ static int inotify_cb(int fd, __unused uint32_t epevents) { } offset += sizeof(inotify_event) + pevent->len; - pevent->name[pevent->len] = '\0'; - if (strncmp(pevent->name, "event", 5)) { + std::string event_name(pevent->name, pevent->len); + if (!android::base::StartsWith(event_name, "event")) { continue; } - android::base::unique_fd dfd(openat(dirfd(dir.get()), pevent->name, O_RDONLY)); + android::base::unique_fd dfd(openat(dirfd(dir.get()), event_name.c_str(), O_RDONLY)); if (dfd == -1) { break; } |