diff options
author | Thomas White <taw@bitwiz.org.uk> | 2009-04-30 23:23:27 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-04-30 23:23:27 +0100 |
commit | 1ad8523c6ce14c0e622210e98072296b5e3d7a51 (patch) | |
tree | 36f695f32ff5ca88db8c77566736e8ab8582e5ab | |
parent | 9bd9fc9e014c72a0ea976a32e3fa3274c7de44dd (diff) |
Un-break the check for failed authentication
-rw-r--r-- | gdri-cmdq-submission.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gdri-cmdq-submission.c b/gdri-cmdq-submission.c index eafe65f..2d7fdaf 100644 --- a/gdri-cmdq-submission.c +++ b/gdri-cmdq-submission.c @@ -61,7 +61,7 @@ static int do_drm_authentication(Display *dpy) /* Get device name */ if ( !DRI2Connect(dpy, root, &driver, &device) ) { fprintf(stderr, "DRI2Connect failed\n"); - return 1; + return -1; } /* Open DRM device */ @@ -69,19 +69,19 @@ static int do_drm_authentication(Display *dpy) if ( fd < 0 ) { fprintf(stderr, "Couldn't open '%s': %s\n", device, strerror(errno)); - return 1; + return -1; } /* Get an authentication token */ if ( drmGetMagic(fd, &magic) ) { fprintf(stderr, "drmGetMagic failed\n"); - return 1; + return -1; } /* Authenticate */ if ( DRI2Authenticate(dpy, root, magic) == False ) { fprintf(stderr, "DRI2Authenticate failed\n"); - return 1; + return -1; } return fd; @@ -106,6 +106,10 @@ int main() } fd = do_drm_authentication(dpy); + if ( fd < 0 ) { + fprintf(stderr, "Couldn't authenticate\n"); + return 1; + } cmds = malloc(2*13*2); |