OSDN Git Service

Fix statsd crash caused by non-existing data folder.
authorYao Chen <yaochen@google.com>
Sat, 25 Nov 2017 23:33:09 +0000 (15:33 -0800)
committerYao Chen <yaochen@google.com>
Sat, 25 Nov 2017 23:33:09 +0000 (15:33 -0800)
Test: manual
Change-Id: Ie470279929ff6ce40c4828a3cdda6d78542a3caa

cmds/statsd/src/storage/StorageManager.cpp

index 96abe6f..a95e899 100644 (file)
@@ -129,7 +129,7 @@ void StorageManager::sendBroadcast(const char* path,
 
 void StorageManager::appendConfigMetricsReport(const char* path, ProtoOutputStream& proto) {
     unique_ptr<DIR, decltype(&closedir)> dir(opendir(path), closedir);
-    if (dir != NULL) {
+    if (dir == NULL) {
         VLOG("Path %s does not exist", path);
         return;
     }