pid1: rename unit_check_gc to unit_may_gc

"check" is unclear: what is true, what is false? Let's rename to "can_gc" and
revert the return value ("positive" values are easier to grok).

v2:
- rename from unit_can_gc to unit_may_gc
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-02-15 13:04:12 +01:00
parent 94e91c8319
commit f2f725e5cc
9 changed files with 53 additions and 45 deletions
+3 -3
View File
@@ -2819,12 +2819,12 @@ SocketType socket_port_type_from_string(const char *s) {
return _SOCKET_TYPE_INVALID;
}
_pure_ static bool socket_check_gc(Unit *u) {
_pure_ static bool socket_may_gc(Unit *u) {
Socket *s = SOCKET(u);
assert(u);
return s->n_connections > 0;
return s->n_connections == 0;
}
static int socket_accept_do(Socket *s, int fd) {
@@ -3324,7 +3324,7 @@ const UnitVTable socket_vtable = {
.active_state = socket_active_state,
.sub_state_to_string = socket_sub_state_to_string,
.check_gc = socket_check_gc,
.may_gc = socket_may_gc,
.sigchld_event = socket_sigchld_event,