@@ -1363,7 +1363,7 @@ static int service_coldplug(Unit *u) {
13631363 service_start_watchdog (s );
13641364
13651365 if (UNIT_ISSET (s -> accept_socket )) {
1366- Socket * socket = SOCKET (UNIT_DEREF (s -> accept_socket ));
1366+ Socket * socket = SOCKET (UNIT_DEREF (s -> accept_socket ));
13671367
13681368 if (socket -> max_connections_per_source > 0 ) {
13691369 SocketPeer * peer ;
@@ -3217,8 +3217,8 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
32173217 } else if (streq (key , "accept-socket" )) {
32183218 Unit * socket ;
32193219
3220- if (u -> type != UNIT_SOCKET ) {
3221- log_unit_debug (u , "Failed to deserialize accept-socket: unit is not a socket" );
3220+ if (unit_name_to_type ( value ) != UNIT_SOCKET ) {
3221+ log_unit_debug (u , "Deserialized accept-socket is not a socket unit, ignoring: %s" , value );
32223222 return 0 ;
32233223 }
32243224
@@ -3227,7 +3227,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
32273227 log_unit_debug_errno (u , r , "Failed to load accept-socket unit '%s': %m" , value );
32283228 else {
32293229 unit_ref_set (& s -> accept_socket , u , socket );
3230- SOCKET (socket )-> n_connections ++ ;
3230+ ASSERT_PTR ( SOCKET (socket ) )-> n_connections ++ ;
32313231 }
32323232
32333233 } else if (streq (key , "socket-fd" )) {
0 commit comments