tree-wide: do not return error codes as bool
This commit is contained in:
parent
511d2ffc8c
commit
756775814c
|
@ -67,7 +67,7 @@ int sd_dhcp_server_set_address(sd_dhcp_server *server, struct in_addr *address,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sd_dhcp_server_is_running(sd_dhcp_server *server) {
|
bool sd_dhcp_server_is_running(sd_dhcp_server *server) {
|
||||||
assert_return(server, -EINVAL);
|
assert_return(server, false);
|
||||||
|
|
||||||
return !!server->receive_message;
|
return !!server->receive_message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -507,7 +507,7 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sd_ipv4ll_is_running(sd_ipv4ll *ll) {
|
bool sd_ipv4ll_is_running(sd_ipv4ll *ll) {
|
||||||
assert_return(ll, -EINVAL);
|
assert_return(ll, false);
|
||||||
|
|
||||||
return !IN_SET(ll->state, IPV4LL_STATE_INIT, IPV4LL_STATE_STOPPED);
|
return !IN_SET(ll->state, IPV4LL_STATE_INIT, IPV4LL_STATE_STOPPED);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,11 +106,11 @@ static bool is_mounted(const char *device)
|
||||||
bool mounted = false;
|
bool mounted = false;
|
||||||
|
|
||||||
if (stat(device, &statbuf) < 0)
|
if (stat(device, &statbuf) < 0)
|
||||||
return -ENODEV;
|
return false;
|
||||||
|
|
||||||
fp = fopen("/proc/self/mountinfo", "re");
|
fp = fopen("/proc/self/mountinfo", "re");
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
return -ENOSYS;
|
return false;
|
||||||
while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) {
|
while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) {
|
||||||
if (makedev(maj, min) == statbuf.st_rdev) {
|
if (makedev(maj, min) == statbuf.st_rdev) {
|
||||||
mounted = true;
|
mounted = true;
|
||||||
|
|
Loading…
Reference in a new issue