Merge "close file in PersistentDataBlockService jni"

This commit is contained in:
Narayan Kamath
2016-02-01 11:31:22 +00:00
committed by Gerrit Code Review

View File

@@ -84,7 +84,11 @@ namespace android {
if (fd < 0) if (fd < 0)
return 0; return 0;
return get_block_device_size(fd); const uint64_t size = get_block_device_size(fd);
close(fd);
return size;
} }
static int com_android_server_PersistentDataBlockService_wipe(JNIEnv *env, jclass, jstring jpath) { static int com_android_server_PersistentDataBlockService_wipe(JNIEnv *env, jclass, jstring jpath) {
@@ -94,7 +98,11 @@ namespace android {
if (fd < 0) if (fd < 0)
return 0; return 0;
return wipe_block_device(fd); const int ret = wipe_block_device(fd);
close(fd);
return ret;
} }
static const JNINativeMethod sMethods[] = { static const JNINativeMethod sMethods[] = {