1
0
mirror of https://github.com/systemd/systemd synced 2026-03-13 16:44:48 +01:00

Compare commits

..

No commits in common. "1f3b407307b998295e617de4c5bc477daebcc80d" and "a53e3697860695bc4db922f7e5b7b3c87454f39a" have entirely different histories.

4 changed files with 15 additions and 6 deletions

View File

@ -1584,13 +1584,14 @@ static int varlink_dump_dns_configuration(sd_json_variant **ret) {
}
static int format_dns_server_one(DNSConfiguration *configuration, DNSServer *s, char **ret) {
bool global;
bool global, with_ifindex;
int r;
assert(s);
assert(ret);
global = !(configuration->ifindex > 0 || configuration->delegate);
with_ifindex = configuration->ifindex <= 0;
if (global && s->ifindex > 0 && s->ifindex != LOOPBACK_IFINDEX) {
/* This one has an (non-loopback) ifindex set, and we were told to suppress those. Hence do so. */
@ -1602,7 +1603,7 @@ static int format_dns_server_one(DNSConfiguration *configuration, DNSServer *s,
s->family,
&s->in_addr,
s->port != 53 ? s->port : 0,
s->ifindex,
with_ifindex ? s->ifindex : 0,
s->server_name,
ret);
if (r < 0)

View File

@ -4,13 +4,12 @@
#include "alloc-util.h"
#include "daemon-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "log.h"
#include "string-util.h"
#include "time-util.h"
int notify_remove_fd_warn(const char *name) {
static int notify_remove_fd_full(int log_level, const char *name) {
int r;
assert(name);
@ -20,13 +19,21 @@ int notify_remove_fd_warn(const char *name) {
"FDNAME=%s", name);
if (r < 0)
return log_full_errno(
ERRNO_IS_NEG_DISCONNECT(r) ? LOG_DEBUG : LOG_WARNING, r,
log_level, r,
"Failed to remove file descriptor \"%s\" from the store, ignoring: %m",
name);
return 0;
}
int notify_remove_fd(const char *name) {
return notify_remove_fd_full(LOG_DEBUG, name);
}
int notify_remove_fd_warn(const char *name) {
return notify_remove_fd_full(LOG_WARNING, name);
}
int notify_remove_fd_warnf(const char *format, ...) {
_cleanup_free_ char *p = NULL;
va_list ap;

View File

@ -21,6 +21,7 @@ static inline void notify_on_cleanup(const char **p) {
(void) sd_notify(false, *p);
}
int notify_remove_fd(const char *name);
int notify_remove_fd_warn(const char *name);
int notify_remove_fd_warnf(const char *format, ...) _printf_(1, 2);
int close_and_notify_warn(int fd, const char *name);

View File

@ -1529,7 +1529,7 @@ int manager_main(Manager *manager) {
/* We will start processing events in the loop below. Before starting processing, let's remove the
* event serialization fd from the fdstore, to avoid retrieving the serialized events again in future
* invocations. Otherwise, the serialized events may be processed multiple times. */
(void) notify_remove_fd_warn("event-serialization");
(void) notify_remove_fd("event-serialization");
r = sd_event_loop(manager->event);
if (r < 0)