diff options
author | Alan Hourihane <alanh@tungstengraphics.com> | 2007-10-23 15:34:12 +0100 |
---|---|---|
committer | Alan Hourihane <alanh@tungstengraphics.com> | 2007-10-23 15:34:12 +0100 |
commit | d5f2b4b411c5ca95d6f66a33d213ece387ac4fc5 (patch) | |
tree | c6f723b2c02e7a6e7cbcd4e7fe8f64b6c5b9e002 /tests | |
parent | 198170ab97bbf2ca6362bb7100e9ed86d90aa51f (diff) | |
parent | a294aa724a1e932fb6017383e08532bfcc914df0 (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auth.c | 4 | ||||
-rw-r--r-- | tests/lock.c | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/auth.c b/tests/auth.c index 4160d1de..9b6fca94 100644 --- a/tests/auth.c +++ b/tests/auth.c @@ -69,10 +69,10 @@ static void client() int drmfd, ret; /* XXX: Should make sure we open the same DRM as the master */ - drmfd = drm_open_any(); - wait_event(0, SERVER_READY); + drmfd = drm_open_any(); + /* Get a client magic number and pass it to the master for auth. */ auth.magic = 0; /* Quiet valgrind */ ret = ioctl(drmfd, DRM_IOCTL_GET_MAGIC, &auth); diff --git a/tests/lock.c b/tests/lock.c index 3f627558..86caa281 100644 --- a/tests/lock.c +++ b/tests/lock.c @@ -87,8 +87,6 @@ client_auth(int drmfd) struct drm_auth auth; int ret; - wait_event(0, SERVER_READY); - /* Get a client magic number and pass it to the master for auth. */ ret = ioctl(drmfd, DRM_IOCTL_GET_MAGIC, &auth); if (ret == -1) @@ -172,8 +170,6 @@ static void test_open_close_locked(drmfd) ret = drmUnlock(drmfd, lock1); if (ret != 0) errx(1, "lock lost during open/close by same pid"); - - close(drmfd); } static void client() @@ -181,6 +177,8 @@ static void client() int drmfd, ret; unsigned int time; + wait_event(0, SERVER_READY); + /* XXX: Should make sure we open the same DRM as the master */ drmfd = drm_open_any(); @@ -201,6 +199,7 @@ static void client() send_event(0, CLIENT_LOCKED); ret = write(commfd[0], &time, sizeof(time)); + close(drmfd); exit(0); } @@ -238,6 +237,8 @@ static void server() if (client_time < unlock_time) errx(1, "Client took lock before server released it"); + + close(drmfd); } int main(int argc, char **argv) |