diff --git a/Xi/setmmap.c b/Xi/setmmap.c index 1c8df53c2..84956409f 100644 --- a/Xi/setmmap.c +++ b/Xi/setmmap.c @@ -103,15 +103,10 @@ ProcXSetDeviceModifierMapping(ClientPtr client) rep.success = ret; WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply), &rep); - } - else if (ret == -1) { - return BadValue; - } - else { - return ret; + return Success; } - return Success; + return ret; } /*********************************************************************** diff --git a/dix/devices.c b/dix/devices.c index c59ea8b3b..82cdc3182 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1771,7 +1771,7 @@ ProcSetModifierMapping(ClientPtr client) rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1], stuff->numKeyPerModifier); - if (rc == MappingFailed || rc == -1) + if (rc == MappingFailed) return BadValue; if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy) return rc; diff --git a/dix/inpututils.c b/dix/inpututils.c index 25a309067..551df7774 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -150,7 +150,7 @@ check_modmap_change(ClientPtr client, DeviceIntPtr dev, KeyCode *modmap) * keycode range. */ if (i < xkb->min_key_code || i > xkb->max_key_code) { client->errorValue = i; - return -1; + return BadValue; } /* None of the new modifiers may be down while we change the