summaryrefslogtreecommitdiff
path: root/src/core/bus-policy.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-30 01:24:48 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-30 01:24:48 +0200
commit524d896ac17518b824b2c94b3b0b2a23c23da08f (patch)
tree44f0e5d16641f99a5408dbf73c97bceba845f2c6 /src/core/bus-policy.c
parent765027454b70c15afdf5507e85ff23cb16e1f889 (diff)
sd-bus: when we get ENOTTY on the HELLO ioctl assume incompatible API version
As perparation for future incompatible kdbus kernel API changes.
Diffstat (limited to 'src/core/bus-policy.c')
-rw-r--r--src/core/bus-policy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/bus-policy.c b/src/core/bus-policy.c
index 064eee1c8a..a6a8fcd4d3 100644
--- a/src/core/bus-policy.c
+++ b/src/core/bus-policy.c
@@ -150,8 +150,11 @@ int bus_kernel_make_starter(
hello->attach_flags_send = _KDBUS_ATTACH_ANY;
hello->attach_flags_recv = _KDBUS_ATTACH_ANY;
- if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0)
+ if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0) {
+ if (errno == ENOTTY) /* Major API change */
+ return -ESOCKTNOSUPPORT;
return -errno;
+ }
/* not interested in any output values */
cmd_free.offset = hello->offset;
@@ -160,7 +163,7 @@ int bus_kernel_make_starter(
/* The higher 32bit of the bus_flags fields are considered
* 'incompatible flags'. Refuse them all for now. */
if (hello->bus_flags > 0xFFFFFFFFULL)
- return -EOPNOTSUPP;
+ return -ESOCKTNOSUPPORT;
return fd;
}