mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +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:
commit
7c43bfecfa
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user