Commit e9c8bd76 by Nicolas Capens Committed by Nicolas Capens

Fix file descriptor leak.

Change-Id: Ie02591ba84ba8a4b204a2cb05179718e397e5c21 Reviewed-on: https://swiftshader-review.googlesource.com/10768Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 75a6185a
......@@ -676,7 +676,10 @@ sw::Format Display::getDisplayFormat() const
if(fd != -1)
{
struct fb_var_screeninfo info;
if(ioctl(fd, FBIOGET_VSCREENINFO, &info) >= 0)
int io = ioctl(fd, FBIOGET_VSCREENINFO, &info);
close(fd);
if(io >= 0)
{
switch(info.bits_per_pixel)
{
......@@ -716,8 +719,6 @@ sw::Format Display::getDisplayFormat() const
UNIMPLEMENTED();
}
}
close(fd);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment