diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-07-07 18:06:04 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-07-10 15:18:08 +0200 |
commit | 992861fb1e4cf410f30ec8f05bd2dc2a14a5a027 (patch) | |
tree | 9d4d5de47d4ebae50838cd7f8ea39b89a3604507 /qga/commands-posix.c | |
parent | af175e85f92c870386ad74f466e29537b79611d3 (diff) |
error: Eliminate error_propagate() manually
When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away. The previous two commits did that for sufficiently simple
cases with Coccinelle. Do it for several more manually.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-37-armbru@redhat.com>
Diffstat (limited to 'qga/commands-posix.c')
-rw-r--r-- | qga/commands-posix.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c index cdbeb59dcc..1a62a3a70d 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -1552,13 +1552,12 @@ static int run_process_child(const char *command[], Error **errp) static bool systemd_supports_mode(SuspendMode mode, Error **errp) { - Error *local_err = NULL; const char *systemctl_args[3] = {"systemd-hibernate", "systemd-suspend", "systemd-hybrid-sleep"}; const char *cmd[4] = {"systemctl", "status", systemctl_args[mode], NULL}; int status; - status = run_process_child(cmd, &local_err); + status = run_process_child(cmd, errp); /* * systemctl status uses LSB return codes so we can expect @@ -1572,7 +1571,6 @@ static bool systemd_supports_mode(SuspendMode mode, Error **errp) return true; } - error_propagate(errp, local_err); return false; } |