summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-05 23:53:17 +0200
committerLennart Poettering <lennart@poettering.net>2014-05-05 23:53:17 +0200
commit856a5a7d769826019d86bc52ae1bc2ed7b13ad44 (patch)
treef84e0d9617fed2e44259f390b601fdc1d7c6f683 /src/shared/util.c
parent73dec31974a315f4329fb302d8efe0e24b9da1d4 (diff)
timesyncd: lookup name server via sd-resolve, support IPv6, react to SIGINT/SITERM
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 5bf9c9fabd..d1dc476ab6 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -2016,7 +2016,6 @@ int ignore_signals(int sig, ...) {
va_list ap;
int r = 0;
-
if (sigaction(sig, &sa, NULL) < 0)
r = -errno;
@@ -2442,6 +2441,24 @@ void sigset_add_many(sigset_t *ss, ...) {
va_end(ap);
}
+int sigprocmask_many(int how, ...) {
+ va_list ap;
+ sigset_t ss;
+ int sig;
+
+ assert_se(sigemptyset(&ss) == 0);
+
+ va_start(ap, how);
+ while ((sig = va_arg(ap, int)) > 0)
+ assert_se(sigaddset(&ss, sig) == 0);
+ va_end(ap);
+
+ if (sigprocmask(how, &ss, NULL) < 0)
+ return -errno;
+
+ return 0;
+}
+
char* gethostname_malloc(void) {
struct utsname u;