From 915ac894aff954366a96f132a85918f91530edff Mon Sep 17 00:00:00 2001 From: Djalal Harouni Date: Wed, 21 Jan 2015 13:33:37 +0100 Subject: [PATCH] match: for KDBUS_CMD_MATCH_REMOVE fail with EBADSLT for invalid match entries For KDBUS_CMD_MATCH_REMOVE, if a match entry is not found or invalid fail with EBADSLT Signed-off-by: Djalal Harouni --- kdbus.txt | 2 +- match.c | 2 +- test/test-race.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kdbus.txt b/kdbus.txt index 2be88a9..c149ccc 100644 --- a/kdbus.txt +++ b/kdbus.txt @@ -2104,7 +2104,7 @@ For KDBUS_CMD_MATCH_ADD: For KDBUS_CMD_MATCH_REMOVE: -EINVAL Illegal flags - -ENOENT A match entry with the given cookie could not be found. + -EBADSLT A match entry with the given cookie could not be found. 15. Internal object relations diff --git a/match.c b/match.c index aae9a85..b1b3731 100644 --- a/match.c +++ b/match.c @@ -326,7 +326,7 @@ static int kdbus_match_db_remove_unlocked(struct kdbus_match_db *mdb, found = true; } - return found ? 0 : -ENOENT; + return found ? 0 : -EBADSLT; } /** diff --git a/test/test-race.c b/test/test-race.c index b159711..ce8621a 100644 --- a/test/test-race.c +++ b/test/test-race.c @@ -284,7 +284,7 @@ TEST_RACE2(kdbus_test_race_byebye_match, 10000, cmd.size = sizeof(cmd); cmd.cookie = 0xdeadbeef; ret = ioctl(env->conn->fd, KDBUS_CMD_MATCH_REMOVE, &cmd); - if (ret == 0 || errno == ENOENT) + if (ret == 0 || errno == EBADSLT) return 0; return -errno; -- 2.34.1