1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 10:25:37 +03:00

Merge pull request #883 from phomes/bool_vs_error_codes

tree-wide: do not return error codes as bool
This commit is contained in:
Daniel Mack 2015-08-06 01:12:45 +02:00
commit 7c43bfecfa
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;