diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-08-06 08:30:25 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-08-06 08:30:25 +0200 |
commit | 98684a0cccadf6644a47859e38386d8b1cd26df0 (patch) | |
tree | d7f78e790d30421972934cc42324b0f9cc3034b1 /src/framebuffer.c | |
parent | framebuffer.c: line drawing (diff) | |
download | crt-calibrator-98684a0cccadf6644a47859e38386d8b1cd26df0.tar.gz crt-calibrator-98684a0cccadf6644a47859e38386d8b1cd26df0.tar.bz2 crt-calibrator-98684a0cccadf6644a47859e38386d8b1cd26df0.tar.xz |
m + beginning of gamma
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/framebuffer.c')
-rw-r--r-- | src/framebuffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/framebuffer.c b/src/framebuffer.c index b830d6e..f783671 100644 --- a/src/framebuffer.c +++ b/src/framebuffer.c @@ -76,12 +76,12 @@ int fb_open(size_t index, framebuffer_t* restrict fb) struct fb_var_screeninfo var_info; int old_errno; - fb->fd = 0; + fb->fd = -1; fb->mem = MAP_FAILED; sprintf(buf, FB_DEVICE_PATTERN, index); fb->fd = open(buf, O_RDWR); - if (fb->fd == 0) + if (fb->fd == -1) goto fail; if (ioctl(fb->fd, FBIOGET_FSCREENINFO, &fix_info) || @@ -116,8 +116,8 @@ int fb_open(size_t index, framebuffer_t* restrict fb) */ void fb_close(framebuffer_t* restrict fb) { - if (fb->fd) - close(fb->fd); + if (fb->fd != -1) + close(fb->fd), fb->fd = -1; } |