summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-message.c6
-rw-r--r--src/libsystemd/sd-event/test-event.c13
2 files changed, 7 insertions, 12 deletions
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index c38b2a5fa5..983e2f62cd 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -803,7 +803,7 @@ _public_ int sd_bus_message_new_method_errorf(
const char *format,
...) {
- _cleanup_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
va_list ap;
assert_return(name, -EINVAL);
@@ -822,7 +822,7 @@ _public_ int sd_bus_message_new_method_errno(
int error,
const sd_bus_error *p) {
- _cleanup_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
+ _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
if (sd_bus_error_is_set(p))
return sd_bus_message_new_method_error(call, m, p);
@@ -839,7 +839,7 @@ _public_ int sd_bus_message_new_method_errnof(
const char *format,
...) {
- _cleanup_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
+ _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL;
va_list ap;
va_start(ap, format);
diff --git a/src/libsystemd/sd-event/test-event.c b/src/libsystemd/sd-event/test-event.c
index 94e98e0077..408e1679a2 100644
--- a/src/libsystemd/sd-event/test-event.c
+++ b/src/libsystemd/sd-event/test-event.c
@@ -79,7 +79,6 @@ static int child_handler(sd_event_source *s, const siginfo_t *si, void *userdata
static int signal_handler(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
sd_event_source *p = NULL;
- sigset_t ss;
pid_t pid;
assert_se(s);
@@ -89,9 +88,7 @@ static int signal_handler(sd_event_source *s, const struct signalfd_siginfo *si,
assert_se(userdata == INT_TO_PTR('e'));
- assert_se(sigemptyset(&ss) >= 0);
- assert_se(sigaddset(&ss, SIGCHLD) >= 0);
- assert_se(sigprocmask(SIG_BLOCK, &ss, NULL) >= 0);
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, -1) >= 0);
pid = fork();
assert_se(pid >= 0);
@@ -109,7 +106,6 @@ static int signal_handler(sd_event_source *s, const struct signalfd_siginfo *si,
static int defer_handler(sd_event_source *s, void *userdata) {
sd_event_source *p = NULL;
- sigset_t ss;
assert_se(s);
@@ -117,9 +113,8 @@ static int defer_handler(sd_event_source *s, void *userdata) {
assert_se(userdata == INT_TO_PTR('d'));
- assert_se(sigemptyset(&ss) >= 0);
- assert_se(sigaddset(&ss, SIGUSR1) >= 0);
- assert_se(sigprocmask(SIG_BLOCK, &ss, NULL) >= 0);
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGUSR1, -1) >= 0);
+
assert_se(sd_event_add_signal(sd_event_source_get_event(s), &p, SIGUSR1, signal_handler, INT_TO_PTR('e')) >= 0);
assert_se(sd_event_source_set_enabled(p, SD_EVENT_ONESHOT) >= 0);
raise(SIGUSR1);
@@ -209,7 +204,7 @@ int main(int argc, char *argv[]) {
assert_se(sd_event_source_set_prepare(z, prepare_handler) >= 0);
/* Test for floating event sources */
- assert_se(sigprocmask_many(SIG_BLOCK, SIGRTMIN+1, -1) == 0);
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGRTMIN+1, -1) >= 0);
assert_se(sd_event_add_signal(e, NULL, SIGRTMIN+1, NULL, NULL) >= 0);
assert_se(write(a[1], &ch, 1) >= 0);