From 325eb669a9611819979f1adf92f2bd72e946223b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 8 Aug 2006 00:23:52 +0300 Subject: fix core request length, exit status, error Make sure we send the correct request length with DEVICE_CORE. exit 1 on failure to find the device, and fix the error message to correctly show which device we couldn't find. --- xsetpointer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xsetpointer.c b/xsetpointer.c index a46c342..25a115d 100644 --- a/xsetpointer.c +++ b/xsetpointer.c @@ -135,9 +135,8 @@ main(int argc, char * argv[]) #endif device = XOpenDevice(dpy, devices[loop].id); if (device) { - fprintf(stderr, "device successfully opened\n"); corectl.status = (core - 1); - corectl.length = sizeof(int); + corectl.length = sizeof(corectl); corectl.control = DEVICE_CORE; XChangeDeviceControl(dpy, device, DEVICE_CORE, (XDeviceControl *)&corectl); @@ -180,11 +179,12 @@ main(int argc, char * argv[]) exit(1); } - if (list || core) { + if (list) { exit(0); } else { - fprintf(stderr, "Extended device %s not found\n", argv[1]); + fprintf(stderr, "Extended device %s not found\n", core ? argv[2] : + argv[1]); exit(1); } } -- cgit v1.2.3