diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-08-08 00:23:52 +0300 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-08-08 00:23:52 +0300 |
commit | 325eb669a9611819979f1adf92f2bd72e946223b (patch) | |
tree | 52288e440a8b0faaae5a8d6b8891e72a63bb7348 | |
parent | 8f05f55390f138deeb17fd16259ce2928cc0d1f0 (diff) |
fix core request length, exit status, errorinput-hotplug
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.
-rw-r--r-- | xsetpointer.c | 8 |
1 files 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); } } |