From c7bdc6291df427f2de9ba191246065f5ff87e11f Mon Sep 17 00:00:00 2001 From: Stefan Lafon Date: Mon, 27 Nov 2017 12:54:21 -0800 Subject: [PATCH] Fix a bug in StorageManager. Test: Ran statsd and statsd_test. Change-Id: I2390c6d2c493981177b08d3861d7bee621253af3 --- cmds/statsd/src/storage/StorageManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds/statsd/src/storage/StorageManager.cpp b/cmds/statsd/src/storage/StorageManager.cpp index a95e899354c93..62f06a760656a 100644 --- a/cmds/statsd/src/storage/StorageManager.cpp +++ b/cmds/statsd/src/storage/StorageManager.cpp @@ -40,7 +40,7 @@ using std::unique_ptr; void StorageManager::writeFile(const char* file, const void* buffer, int numBytes) { int fd = open(file, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR); - if (fd != -1) { + if (fd == -1) { VLOG("Attempt to access %s but failed", file); return; }