ctemp

Set color temperature
git clone git://git.akobets.xyz/ctemp
Log | Files | Refs | README | LICENSE

commit d98f920aa5957cd01f1647f09f50f6d53ef018fa
parent 2a66d1e3b8367e17ef5830811be64f3b235d77e4
Author: Artem Kobets <artem@akobets.xyz>
Date:   Thu,  5 Mar 2020 11:43:17 +0200

pre-release edits

Diffstat:
Mconfig.mk | 2+-
Mctemp.c | 9++++-----
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/config.mk b/config.mk @@ -9,7 +9,7 @@ MANPREFIX = $(PREFIX)/share/man # DRM support ENABLE_DRM = ON -# Quartz (OS X) support +# Quartz (macOS/OS X) support ENABLE_QUARTZ = OFF # X11 support ENABLE_X = ON diff --git a/ctemp.c b/ctemp.c @@ -1,6 +1,6 @@ /* See LICENSE for license details. */ -#if !defined(DRM_SUPPORT) && !defined(X_SUPPORT) && !defined(QUARTZ_SUPPORT) +#if !defined(DRM_SUPPORT) && !defined(QUARTZ_SUPPORT) && !defined(X_SUPPORT) #error "No supported interface configured" #endif @@ -80,7 +80,7 @@ drm_handler(int temp) /* open DRM device with minor number 0 */ snprintf(dev_name, sizeof(dev_name), DRM_DEV_NAME, DRM_DIR_NAME, 0); - fd = open(dev_name, O_RDWR | O_CLOEXEC, 0); + fd = open(dev_name, O_RDWR, 0); if (fd < 0) die("cannot open %s: %s\n", dev_name, strerror(errno)); @@ -223,7 +223,7 @@ x_handler(int temp) gamma_size = XRRGetCrtcGammaSize(dpy, crtc_id); crtc_gamma = XRRAllocGamma(gamma_size); if (crtc_gamma == NULL) - die("XRandR alloc: %s\n", strerror(errno)); + die("malloc: %s\n", strerror(errno)); for (i = 0; i < gamma_size; i++) { float r = 65535.0 * i / gamma_size; @@ -273,12 +273,11 @@ main(int argc, char **argv) { ARGBEGIN { case 'i': { if_name = EARGF(usage()); - for (i = 0; i < LEN(interfaces); i++) { + for (i = 0; i < LEN(interfaces); i++) if (strcmp(if_name, interfaces[i].name) == 0) { handler = interfaces[i].handler; break; } - } if (handler == NULL) usage(); break;