summaryrefslogtreecommitdiffstats
path: root/src/shared/varlink.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-01-17 11:09:05 +0100
committerLennart Poettering <lennart@poettering.net>2024-01-17 16:20:54 +0100
commit71d0ecc5b9e0a2d451fb1af0f6bf7af02d0286da (patch)
tree290d3ae9c8cbffd4ea7cf35fb54d617896a84ef3 /src/shared/varlink.h
parentvarlink: drop "ret_flags" parameter from varlink_call() (diff)
downloadsystemd-71d0ecc5b9e0a2d451fb1af0f6bf7af02d0286da.tar.xz
systemd-71d0ecc5b9e0a2d451fb1af0f6bf7af02d0286da.zip
varlink: introduce varlink_call_and_log() which calls and then logs an error
As it turns out we do this in a similar way at various times (and sometimes incorrectly), hence add a common implementation to share the code and fix the incorrect behaviour.
Diffstat (limited to 'src/shared/varlink.h')
-rw-r--r--src/shared/varlink.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/varlink.h b/src/shared/varlink.h
index a54b1f0381..622ab797c5 100644
--- a/src/shared/varlink.h
+++ b/src/shared/varlink.h
@@ -92,6 +92,8 @@ int varlink_call_full(Varlink *v, const char *method, JsonVariant *parameters, J
static inline int varlink_call(Varlink *v, const char *method, JsonVariant *parameters, JsonVariant **ret_parameters, const char **ret_error_id) {
return varlink_call_full(v, method, parameters, ret_parameters, ret_error_id, NULL);
}
+int varlink_call_and_log(Varlink *v, const char *method, JsonVariant *parameters, JsonVariant **ret_parameters);
+
int varlink_callb_ap(Varlink *v, const char *method, JsonVariant **ret_parameters, const char **ret_error_id, VarlinkReplyFlags *ret_flags, va_list ap);
static inline int varlink_callb_full(Varlink *v, const char *method, JsonVariant **ret_parameters, const char **ret_error_id, VarlinkReplyFlags *ret_flags, ...) {
va_list ap;
@@ -111,6 +113,7 @@ static inline int varlink_callb(Varlink *v, const char *method, JsonVariant **re
va_end(ap);
return r;
}
+int varlink_callb_and_log(Varlink *v, const char *method, JsonVariant **ret_parameters, ...);
/* Send method call and begin collecting all 'more' replies into an array, finishing when a final reply is sent */
int varlink_collect(Varlink *v, const char *method, JsonVariant *parameters, JsonVariant **ret_parameters, const char **ret_error_id, VarlinkReplyFlags *ret_flags);