On Thu Aug 21 08:49:31 2025 +0000, Rémi Bernon wrote:
Why change the BOOL to an int when it only has two possible values after all and is later set with a boolean value? What about this instead?
ret = !!input_shm->keystate_lock; /* needs a request for sync_input_keystate */ keystate_serial = input_shm->keystate_serial; retval = (signed char)(input_shm->keystate[vkey & 0xff] & 0x81); } if (!ret) /* check if keystates are synced already and we can safely skip the request */ { struct object_lock lock = OBJECT_LOCK_INIT; const desktop_shm_t *desktop_shm; while ((status = get_shared_desktop( &lock, &desktop_shm )) == STATUS_PENDING) ret = keystate_serial == desktop_shm->keystate_serial; } if (!ret) SERVER_START_REQ( get_key_state )
The existing code de-facto falls back to server call always if there was an error accessing shared memory. I thought if that can happen this should fallback to server call and not to try to rely on any serial checks as `retval` is wrong already. Relying on serial comparison is possible (if changing default value) but seems not straightforward. Is it not the case?