• Peter Harris's avatar
    Fix id in error when resource does not exist · 97a8353e
    Peter Harris authored
    Always set client->errorValue before returning an error.
    
    Test program:
    
    int main(int argc, char *argv[]) {
        int screen = 0;
        xcb_connection_t *c = xcb_connect(NULL, &screen);
        if (!c) {
            printf("Cannot connect\n");
            return 1;
        }
    
        xcb_void_cookie_t tok = xcb_free_gc_checked(c, BAD_VALUE);
        xcb_g_context_error_t *err = (xcb_g_context_error_t *)xcb_request_check(c, tok);
        if (!err) {
            printf("Unexpected request success\n");
            return 1;
        }
        if (err->bad_value != BAD_VALUE) {
            printf("Error: Got 0x%X, expected 0x%X\n", err->bad_value, BAD_VALUE);
            return 1;
        }
        printf("Success! Got expected bad value of 0x%X\n", BAD_VALUE);
        return 0;
    }
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: Peter Harris's avatarPeter Harris <pharris@opentext.com>
    97a8353e
Name
Last commit
Last update
Xext Loading commit data...
Xi Loading commit data...
composite Loading commit data...
config Loading commit data...
damageext Loading commit data...
dbe Loading commit data...
dix Loading commit data...
doc Loading commit data...
dri3 Loading commit data...
exa Loading commit data...
fb Loading commit data...
glamor Loading commit data...
glx Loading commit data...
hw Loading commit data...
include Loading commit data...
m4 Loading commit data...
man Loading commit data...
mi Loading commit data...
miext Loading commit data...
os Loading commit data...
present Loading commit data...
pseudoramiX Loading commit data...
randr Loading commit data...
record Loading commit data...
render Loading commit data...
test Loading commit data...
xfixes Loading commit data...
xkb Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
Makefile.am Loading commit data...
README Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
devbook.am Loading commit data...
docbook.am Loading commit data...
fix-miregion Loading commit data...
fix-miregion-private Loading commit data...
fix-patch-whitespace Loading commit data...
fix-region Loading commit data...
manpages.am Loading commit data...
xorg-server.m4 Loading commit data...
xorg-server.pc.in Loading commit data...
xserver.ent.in Loading commit data...