display: Close 0 fds
0 can be a valid file descriptor, make sure 0 fds are closed Change-Id: I2bf2280d70eda74fa0b0a886ea54ecefc6854b24
This commit is contained in:
@@ -450,7 +450,7 @@ bool ExternalDisplay::openFrameBuffer(int fbNum)
|
|||||||
bool ExternalDisplay::closeFrameBuffer()
|
bool ExternalDisplay::closeFrameBuffer()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if(mFd > 0) {
|
if(mFd >= 0) {
|
||||||
ret = close(mFd);
|
ret = close(mFd);
|
||||||
mFd = -1;
|
mFd = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,11 +390,11 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
|||||||
if(list->hwLayers[i].compositionType == HWC_OVERLAY ||
|
if(list->hwLayers[i].compositionType == HWC_OVERLAY ||
|
||||||
list->hwLayers[i].compositionType == HWC_FRAMEBUFFER_TARGET) {
|
list->hwLayers[i].compositionType == HWC_FRAMEBUFFER_TARGET) {
|
||||||
//Close the acquireFenceFds
|
//Close the acquireFenceFds
|
||||||
if(list->hwLayers[i].acquireFenceFd > 0) {
|
if(list->hwLayers[i].acquireFenceFd >= 0) {
|
||||||
close(list->hwLayers[i].acquireFenceFd);
|
close(list->hwLayers[i].acquireFenceFd);
|
||||||
list->hwLayers[i].acquireFenceFd = -1;
|
list->hwLayers[i].acquireFenceFd = -1;
|
||||||
}
|
}
|
||||||
if(fd > 0) {
|
if(fd >= 0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user