Skip to content

Commit

Permalink
timesyncd: lookup name server via sd-resolve, support IPv6, react to …
Browse files Browse the repository at this point in the history
…SIGINT/SITERM
  • Loading branch information
poettering committed May 5, 2014
1 parent 73dec31 commit 856a5a7
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 152 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4023,6 +4023,7 @@ systemd_timesyncd_LDADD = \
libsystemd-label.la \
libsystemd-internal.la \
libsystemd-shared.la \
libsystemd-resolve.la \
-lm

rootlibexec_PROGRAMS += \
Expand Down
19 changes: 18 additions & 1 deletion src/shared/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,6 @@ int ignore_signals(int sig, ...) {
va_list ap;
int r = 0;


if (sigaction(sig, &sa, NULL) < 0)
r = -errno;

Expand Down Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/shared/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ char* dirname_malloc(const char *path);
void rename_process(const char name[8]);

void sigset_add_many(sigset_t *ss, ...);
int sigprocmask_many(int how, ...);

bool hostname_is_set(void);

Expand Down

0 comments on commit 856a5a7

Please sign in to comment.