proc-cmdline: return proper errors from shall_restore_state()

Let's not eat up errors in shall_restore_state(), but in the consumers
instead, just for the sake of keeping the library calls generic.
This commit is contained in:
Lennart Poettering
2015-11-02 23:44:05 +01:00
parent 19854865a8
commit 934ae16baf
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -381,7 +381,7 @@ int main(int argc, char *argv[]) {
_cleanup_free_ char *value = NULL;
const char *clamp;
if (!shall_restore_state())
if (shall_restore_state() == 0)
return EXIT_SUCCESS;
if (!validate_device(udev, device))
+1 -1
View File
@@ -141,5 +141,5 @@ int shall_restore_state(void) {
if (r == 0)
return true;
return parse_boolean(value) != 0;
return parse_boolean(value);
}
+1 -1
View File
@@ -212,7 +212,7 @@ static int load_state(
assert(udev);
assert(event);
if (!shall_restore_state())
if (shall_restore_state() == 0)
return 0;
r = find_device(udev, event, &device);