~aperezdc/drmgamma

2919a33a86b7f8b876b6e2b34ed9973195f0630d — Adrian Perez de Castro 3 years ago cc58977
Close file descriptor before error return
1 files changed, 3 insertions(+), 1 deletions(-)

M drmgamma.c
M drmgamma.c => drmgamma.c +3 -1
@@ 186,8 186,10 @@ main(int argc, char *argv[])
        return error("Cannot open '%s': %s.", devnode, strerror(errno));

    if (!drmIsMaster(fd)) {
        if (drmSetMaster(fd))
        if (drmSetMaster(fd)) {
            close(fd);
            return error("Could not become DRM master: %s.", strerror(errno));
        }
    }

    drmModeRes *resources = drmModeGetResources(fd);