_cleanup_strv_free_ char **words = NULL;
assert(getter);
- r = strv_split_quoted(&words, getter);
+ r = strv_split_quoted(&words, getter, false);
if (r < 0) {
- log_error("Failed to split getter option: %s", strerror(-r));
+ log_error_errno(r, "Failed to split getter option: %m");
return r;
}
r = strv_extend(&words, url);
if (r < 0) {
- log_error("Failed to create command line: %s", strerror(-r));
+ log_error_errno(r, "Failed to create command line: %m");
return r;
}
goto error;
}
- r = sd_event_source_set_name(source->event, name);
+ r = sd_event_source_set_description(source->event, name);
if (r < 0) {
- log_error("Failed to set source name for fd:%d: %s", fd, strerror(-r));
+ log_error_errno(r, "Failed to set source name for fd:%d: %m", fd);
goto error;
}
snprintf(name, sizeof(name), "raw-socket-%d", fd);
- r = sd_event_source_set_name(s->listen_event, name);
+ r = sd_event_source_set_description(s->listen_event, name);
if (r < 0)
return r;
r = fd_nonblock(fd, true);
if (r < 0) {
- log_error("Failed to make fd:%d nonblocking: %s", fd, strerror(-r));
+ log_error_errno(r, "Failed to make fd:%d nonblocking: %m", fd);
return r;
}
epoll_fd, EPOLLIN,
dispatch_http_event, d);
if (r < 0) {
- log_error("Failed to add event callback: %s", strerror(-r));
+ log_error_errno(r, "Failed to add event callback: %m");
goto error;
}
- r = sd_event_source_set_name(d->event, "epoll-fd");
+ r = sd_event_source_set_description(d->event, "epoll-fd");
if (r < 0) {
- log_error("Failed to set source name: %s", strerror(-r));
+ log_error_errno(r, "Failed to set source name: %m");
goto error;
}
r = hashmap_put(s->daemons, &d->fd, d);
if (r < 0) {
- log_error("Failed to add daemon to hashmap: %s", strerror(-r));
+ log_error_errno(r, "Failed to add daemon to hashmap: %m");
goto error;
}
if (r < 0)
return r;
- r = sd_event_source_set_name(s->sigterm_event, "sigterm");
- if (r < 0)
- return r;
-
r = sd_event_add_signal(s->events, &s->sigint_event, SIGINT, NULL, s);
if (r < 0)
return r;
- r = sd_event_source_set_name(s->sigint_event, "sigint");
- if (r < 0)
- return r;
-
return 0;
}
r = sd_event_default(&s->events);
if (r < 0) {
- log_error("Failed to allocate event loop: %s", strerror(-r));
+ log_error_errno(r, "Failed to allocate event loop: %m");
return r;
}
r = getnameinfo_pretty(fd, &hostname);
if (r < 0) {
- log_error("Failed to retrieve remote name: %s", strerror(-r));
+ log_error_errno(r, "Failed to retrieve remote name: %m");
return r;
}
} else if (r == -EAGAIN) {
return 0;
} else if (r < 0) {
- log_info("Closing connection: %s", strerror(-r));
+ log_info_errno(r, "Closing connection: %m");
remove_source(server, fd);
return 0;
} else
r = socket_address_print(addr, &a);
if (r < 0) {
- log_error("socket_address_print(): %s", strerror(-r));
+ log_error_errno(r, "socket_address_print(): %m");
close(fd2);
return r;
}
r = sd_event_set_watchdog(s.events, true);
if (r < 0)
- log_error("Failed to enable watchdog: %s", strerror(-r));
+ log_error_errno(r, "Failed to enable watchdog: %m");
else
log_debug("Watchdog is %s.", r > 0 ? "enabled" : "disabled");
r = sd_event_run(s.events, -1);
if (r < 0) {
- log_error("Failed to run event loop: %s", strerror(-r));
+ log_error_errno(r, "Failed to run event loop: %m");
break;
}
}