along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
#include <stddef.h>
-#include "log.h"
#include "util.h"
#include "sd-bus.h"
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-util.h"
-#include "strv.h"
-#include "def.h"
-#include "bus-control.h"
#include "synthesize.h"
-static int synthetic_driver_send(sd_bus *b, sd_bus_message *m) {
+int synthetic_driver_send(sd_bus *b, sd_bus_message *m) {
int r;
assert(b);
}
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);
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;