~kennylevinsen/seatd-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] evdev: cast ioctl request to int

Details
Message ID
<Z0pfeVaVd_Z7nhWq@pidgin.makrotopia.org>
DKIM signature
missing
Download raw message
Patch: +1 -1
Compile on PPC64 fails with error:
../common/evdev.c: In function 'evdev_revoke':
../common/evdev.c:26:26: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2147763601' to '-2147203695' [-Werror=overflow]
   26 |         return ioctl(fd, EVIOCREVOKE, NULL);

Prevent overflow warning by using explicit cast to int.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 common/evdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/evdev.c b/common/evdev.c
index 9a27578..90638f0 100644
--- a/common/evdev.c
+++ b/common/evdev.c
@@ -23,7 +23,7 @@ int path_is_evdev(const char *path) {
}

int evdev_revoke(int fd) {
	return ioctl(fd, EVIOCREVOKE, NULL);
	return ioctl(fd, (int)EVIOCREVOKE, NULL);
}
#else
int path_is_evdev(const char *path) {
-- 
2.47.1
Details
Message ID
<4a552186-3915-4b91-937d-80748e5947c8@kl.wtf>
In-Reply-To
<Z0pfeVaVd_Z7nhWq@pidgin.makrotopia.org> (view parent)
DKIM signature
pass
Download raw message
Applied, thanks!
Reply to thread Export thread (mbox)