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:
Naseer Ahmed
2013-02-15 19:13:50 -05:00
parent 91dae25d49
commit f53b377bde
2 changed files with 3 additions and 3 deletions

View File

@@ -450,7 +450,7 @@ bool ExternalDisplay::openFrameBuffer(int fbNum)
bool ExternalDisplay::closeFrameBuffer()
{
int ret = 0;
if(mFd > 0) {
if(mFd >= 0) {
ret = close(mFd);
mFd = -1;
}

View File

@@ -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 ||
list->hwLayers[i].compositionType == HWC_FRAMEBUFFER_TARGET) {
//Close the acquireFenceFds
if(list->hwLayers[i].acquireFenceFd > 0) {
if(list->hwLayers[i].acquireFenceFd >= 0) {
close(list->hwLayers[i].acquireFenceFd);
list->hwLayers[i].acquireFenceFd = -1;
}
if(fd > 0) {
if(fd >= 0) {
close(fd);
fd = -1;
}