Make file backed strings dup the provided file descriptor.

Reviewed By: mhorowitz

Differential Revision: D4326645

fbshipit-source-id: 2741f1fead4f42ae76787f8a70c1e787445b827d
This commit is contained in:
Ashok Menon
2016-12-16 06:13:40 -08:00
committed by Facebook Github Bot
parent 349bbb54f7
commit fa082796a5
3 changed files with 14 additions and 5 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
#include <sys/stat.h>
#include <folly/Memory.h>
#include <folly/ScopeGuard.h>
namespace facebook {
namespace react {
@@ -51,7 +52,7 @@ std::unique_ptr<const JSBigOptimizedBundleString> JSBigOptimizedBundleString::fr
uint8_t encoding;
struct stat fileInfo;
int fd = -1;
SCOPE_FAIL { CHECK(fd == -1 || ::close(fd) == 0); };
SCOPE_EXIT { CHECK(fd == -1 || ::close(fd) == 0); };
{
auto metaPath = bundlePath + UNPACKED_META_PATH_SUFFIX;