summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Gao2017-01-18 20:14:17 -0600
committerJosh Gao2017-01-20 17:26:00 -0600
commitfb9a7e5995d2e6c2c7f08080201d41fe0f6c4b53 (patch)
tree537426b10cbfb8bcac1fc0c6c1990560c7626c66
parentc42bd0931fbe970e28dabee6c81ebd069355ac0c (diff)
downloadplatform-system-core-fb9a7e5995d2e6c2c7f08080201d41fe0f6c4b53.tar.gz
platform-system-core-fb9a7e5995d2e6c2c7f08080201d41fe0f6c4b53.tar.xz
platform-system-core-fb9a7e5995d2e6c2c7f08080201d41fe0f6c4b53.zip
adb: check for and report inotify_init1 failure.
Bug: http://b/34396687 Test: mma Change-Id: I55ea84db49017a6533ac54db5072e3e75ba30097
-rw-r--r--adb/adb_auth_host.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/adb/adb_auth_host.cpp b/adb/adb_auth_host.cpp
index ec9b1c364..c3f1fe07d 100644
--- a/adb/adb_auth_host.cpp
+++ b/adb/adb_auth_host.cpp
@@ -388,7 +388,13 @@ static void adb_auth_inotify_update(int fd, unsigned fd_event, void*) {
388 388
389static void adb_auth_inotify_init(const std::set<std::string>& paths) { 389static void adb_auth_inotify_init(const std::set<std::string>& paths) {
390 LOG(INFO) << "adb_auth_inotify_init..."; 390 LOG(INFO) << "adb_auth_inotify_init...";
391
391 int infd = inotify_init1(IN_CLOEXEC | IN_NONBLOCK); 392 int infd = inotify_init1(IN_CLOEXEC | IN_NONBLOCK);
393 if (infd < 0) {
394 PLOG(ERROR) << "failed to create inotify fd";
395 return;
396 }
397
392 for (const std::string& path : paths) { 398 for (const std::string& path : paths) {
393 int wd = inotify_add_watch(infd, path.c_str(), IN_CREATE | IN_MOVED_TO); 399 int wd = inotify_add_watch(infd, path.c_str(), IN_CREATE | IN_MOVED_TO);
394 if (wd < 0) { 400 if (wd < 0) {