summaryrefslogtreecommitdiff
path: root/src/hibernate-resume
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-06 21:53:34 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-07 01:19:56 +0100
commitb5884878a2874447b2a9f07f324a7cd909d96d48 (patch)
tree7187916b29404dad30f53be8ed0393a095571e0d /src/hibernate-resume
parentf2997962ff8aeea577bed878d3bc4e4f64784e45 (diff)
util: simplify proc_cmdline() to reuse get_process_cmdline()
Also, make all parsing of the kernel cmdline non-fatal.
Diffstat (limited to 'src/hibernate-resume')
-rw-r--r--src/hibernate-resume/hibernate-resume-generator.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/hibernate-resume/hibernate-resume-generator.c b/src/hibernate-resume/hibernate-resume-generator.c
index f40721662e..41f65d984e 100644
--- a/src/hibernate-resume/hibernate-resume-generator.c
+++ b/src/hibernate-resume/hibernate-resume-generator.c
@@ -45,6 +45,9 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
static int process_resume(void) {
_cleanup_free_ char *name = NULL, *lnk = NULL;
+ if (!arg_resume_dev)
+ return 0;
+
name = unit_name_from_path_instance("systemd-hibernate-resume", arg_resume_dev, ".service");
if (!name)
return log_oom();
@@ -83,12 +86,11 @@ int main(int argc, char *argv[]) {
if (!in_initrd())
return EXIT_SUCCESS;
- if (parse_proc_cmdline(parse_proc_cmdline_item) < 0)
- return EXIT_FAILURE;
-
- if (arg_resume_dev != NULL)
- r = process_resume();
+ r = parse_proc_cmdline(parse_proc_cmdline_item);
+ if (r < 0)
+ log_warning("Failed to parse kernel command line, ignoring: %s", strerror(-r));
+ r = process_resume();
free(arg_resume_dev);
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;