summaryrefslogtreecommitdiff
path: root/src/bus-proxyd/synthesize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bus-proxyd/synthesize.c')
-rw-r--r--src/bus-proxyd/synthesize.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/bus-proxyd/synthesize.c b/src/bus-proxyd/synthesize.c
index 36ffe2930e..e1b0fd3535 100644
--- a/src/bus-proxyd/synthesize.c
+++ b/src/bus-proxyd/synthesize.c
@@ -83,7 +83,6 @@ int synthetic_reply_method_errorf(sd_bus_message *call, const char *name, const
}
int synthetic_reply_method_errno(sd_bus_message *call, int error, const sd_bus_error *p) {
-
_cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
assert(call);
@@ -99,6 +98,22 @@ int synthetic_reply_method_errno(sd_bus_message *call, int error, const sd_bus_e
return synthetic_reply_method_error(call, &berror);
}
+int synthetic_reply_method_errnof(sd_bus_message *call, int error, const char *format, ...) {
+ _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
+ va_list ap;
+
+ assert(call);
+
+ if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
+ return 0;
+
+ va_start(ap, format);
+ sd_bus_error_set_errnofv(&berror, error, format, ap);
+ va_end(ap);
+
+ return synthetic_reply_method_error(call, &berror);
+}
+
int synthetic_reply_method_return(sd_bus_message *call, const char *types, ...) {
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
int r;