tree-wide: do not return error codes as bool

This commit is contained in:
Thomas Hindoe Paaboel Andersen 2015-08-06 00:32:25 +02:00
parent 511d2ffc8c
commit 756775814c
3 changed files with 4 additions and 4 deletions

View File

@ -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) {
assert_return(server, -EINVAL);
assert_return(server, false);
return !!server->receive_message;
}

View File

@ -507,7 +507,7 @@ error:
}
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);
}

View File

@ -106,11 +106,11 @@ static bool is_mounted(const char *device)
bool mounted = false;
if (stat(device, &statbuf) < 0)
return -ENODEV;
return false;
fp = fopen("/proc/self/mountinfo", "re");
if (fp == NULL)
return -ENOSYS;
return false;
while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) {
if (makedev(maj, min) == statbuf.st_rdev) {
mounted = true;