aboutsummaryrefslogtreecommitdiff
path: root/brightnessctl.c
diff options
context:
space:
mode:
authorGravatar Mykyta Holubakha <hilobakho@gmail.com>2020-02-02 13:58:53 +0100
committerGravatar Mykyta Holubakha <hilobakho@gmail.com>2020-02-02 13:58:53 +0100
commit052e56ccd662fba25abd7780be5feb66a8e0710b (patch)
treea680e6f246014def3fbde7a686dca7b76881150f /brightnessctl.c
parent7504b58765cafae7f7628fe02204883a200a4b10 (diff)
Build fixup
systemd install fixup Closes #42, #44
Diffstat (limited to 'brightnessctl.c')
-rw-r--r--brightnessctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/brightnessctl.c b/brightnessctl.c
index a210b87..6045ec3 100644
--- a/brightnessctl.c
+++ b/brightnessctl.c
@@ -35,7 +35,7 @@ static char *_cat_with(char, ...);
static char *dir_child(char *, char*);
static char *device_path(struct device *);
static char *class_path(char *);
-static void apply_value(struct device *, struct value *);
+static unsigned int calc_value(struct device *, struct value *);
static int apply_operation(struct device *, enum operation, struct value *);
static bool parse_value(struct value *, char *);
static bool do_write_device(struct device *);
@@ -48,6 +48,7 @@ static struct device *find_device(struct device **, char *);
static bool save_device_data(struct device *);
static bool restore_device_data(struct device *);
static bool ensure_dir(char *);
+static bool ensure_dev_dir(struct device *);
#define ensure_run_dir() ensure_dir(run_dir)
#ifdef ENABLE_SYSTEMD
@@ -251,7 +252,7 @@ int apply_operation(struct device *dev, enum operation operation, struct value *
fprintf(stdout, "%u\n", dev->max_brightness);
return 0;
case SET:
- apply_value(dev, val);
+ dev->curr_brightness = calc_value(dev, val);
if (!p.pretend)
if (!write_device(dev))
goto fail;