From 524d896ac17518b824b2c94b3b0b2a23c23da08f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 30 Apr 2015 01:24:48 +0200 Subject: sd-bus: when we get ENOTTY on the HELLO ioctl assume incompatible API version As perparation for future incompatible kdbus kernel API changes. --- src/core/bus-policy.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/bus-policy.c') 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; } -- cgit v1.2.3-54-g00ecf