mirror of
https://github.com/systemd/systemd
synced 2024-10-07 00:30:59 +00:00
backlight: handle loading truncated file
I had accidentally filled my /var partition. This caused backlight to fail to start even with disk space, because the brightness files were truncated to zero size: systemd-backlight[624]: acpi_video0: Failed to parse brightness "": Invalid argument systemd-backlight[624]: acpi_video0: Failed to write system 'brightness' attribute: No such device or address systemd[1]: systemd-backlight@backlight:acpi_video0.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: systemd-backlight@backlight:acpi_video0.service: Failed with result 'exit-code'. systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:acpi_video0. Handle a truncated file like non-existent file.
This commit is contained in:
parent
d6062e3b4f
commit
cbed254f96
|
@ -379,7 +379,7 @@ static int run(int argc, char *argv[]) {
|
|||
clamp = shall_clamp(device);
|
||||
|
||||
r = read_one_line_file(saved, &value);
|
||||
if (r == -ENOENT) {
|
||||
if (IN_SET(r, -ENOENT, 0)) {
|
||||
const char *curval;
|
||||
|
||||
/* Fallback to clamping current brightness or exit early if
|
||||
|
|
Loading…
Reference in a new issue