summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-08-06 01:12:45 +0200
committerDaniel Mack <github@zonque.org>2015-08-06 01:12:45 +0200
commit7c43bfecfa2d07374b6f805cc03c9571d1d3e1fc (patch)
tree9faacdee98f007aaaf0f14efd49326a6b583c99c /src
parentc2f147382d8ad174dae0a9b60088807a07dc6415 (diff)
parent756775814cf69471f74ce853745bba69f2ba94ef (diff)
Merge pull request #883 from phomes/bool_vs_error_codes
tree-wide: do not return error codes as bool
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c2
-rw-r--r--src/libsystemd-network/sd-ipv4ll.c2
-rw-r--r--src/udev/cdrom_id/cdrom_id.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index a0af256dee..faeab0fd30 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -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;
}
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c
index 0cb77ccf71..f080c5c0a7 100644
--- a/src/libsystemd-network/sd-ipv4ll.c
+++ b/src/libsystemd-network/sd-ipv4ll.c
@@ -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);
}
diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c
index 3d74ae50f1..775da0355d 100644
--- a/src/udev/cdrom_id/cdrom_id.c
+++ b/src/udev/cdrom_id/cdrom_id.c
@@ -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;