diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-31 13:25:52 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-08-03 11:03:08 +1000 |
commit | b95995c6665d147e4857d8616b57aa8a25fc3f6f (patch) | |
tree | 9249568b6522dca5dfbbabfdd1016020764eae81 | |
parent | 1d89e2f632cf6c702ae5002f81e5783f3ba1b9ae (diff) |
Split rc and ret into two different variables.
This is a cosmetic change only.
ioctls - though not the ones used here - may return non-zero non-negative
values to the caller. Using the return value as a boolean and as return
value for ioctls at the same time could result in false positives if one
ioctl returns 1. This cannot happen in this part of the code but a
separation of the two improves readability.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Christoph Brill <egore911@egore911.de>
-rw-r--r-- | src/eventcomm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c index ae853f2..d8138d4 100644 --- a/src/eventcomm.c +++ b/src/eventcomm.c @@ -82,37 +82,37 @@ EventDeviceOnHook(LocalDevicePtr local, SynapticsParameters *para) static Bool event_query_is_touchpad(int fd, BOOL grab) { - int ret = FALSE; + int ret = FALSE, rc; unsigned long evbits[NBITS(EV_MAX)] = {0}; unsigned long absbits[NBITS(ABS_MAX)] = {0}; unsigned long keybits[NBITS(KEY_MAX)] = {0}; if (grab) { - SYSCALL(ret = ioctl(fd, EVIOCGRAB, (pointer)1)); - if (ret < 0) + SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)1)); + if (rc < 0) return FALSE; } /* Check for ABS_X, ABS_Y, ABS_PRESSURE and BTN_TOOL_FINGER */ - SYSCALL(ret = ioctl(fd, EVIOCGBIT(0, sizeof(evbits)), evbits)); - if (ret < 0) + SYSCALL(rc = ioctl(fd, EVIOCGBIT(0, sizeof(evbits)), evbits)); + if (rc < 0) goto unwind; if (!TEST_BIT(EV_SYN, evbits) || !TEST_BIT(EV_ABS, evbits) || !TEST_BIT(EV_KEY, evbits)) goto unwind; - SYSCALL(ret = ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits)); - if (ret < 0) + SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits)); + if (rc < 0) goto unwind; if (!TEST_BIT(ABS_X, absbits) || !TEST_BIT(ABS_Y, absbits)) goto unwind; - SYSCALL(ret = ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits)); - if (ret < 0) + SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits)); + if (rc < 0) goto unwind; /* we expect touchpad either report raw pressure or touches */ |