1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-18 10:04:04 +03:00

core/socket: use UNIT_ISSET rather than _DEREF where suitable

This commit is contained in:
Mike Yuan 2024-08-25 23:29:26 +02:00
parent 2e8e32e6d5
commit f220d98945
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -328,7 +328,7 @@ static int socket_add_extras(Socket *s) {
if (have_non_accept_socket(s)) {
if (!UNIT_DEREF(s->service)) {
if (!UNIT_ISSET(s->service)) {
Unit *x;
r = unit_load_related_unit(u, ".service", &x);
@ -416,7 +416,7 @@ static int socket_verify(Socket *s) {
if (s->accept && s->max_connections <= 0)
return log_unit_error_errno(UNIT(s), SYNTHETIC_ERRNO(ENOEXEC), "MaxConnection= setting too small. Refusing.");
if (s->accept && UNIT_DEREF(s->service))
if (s->accept && UNIT_ISSET(s->service))
return log_unit_error_errno(UNIT(s), SYNTHETIC_ERRNO(ENOEXEC), "Explicit service configuration for accepting socket units not supported. Refusing.");
if (s->exec_context.pam_name && s->kill_context.kill_mode != KILL_CONTROL_GROUP)