updated on Fri Jan 6 08:01:17 UTC 2012
[aur-mirror.git] / hal / macbook-fix-ioperm.patch
blob14d0b392db836fd7661b15529969d081ddfd9837
1 From 597c1ffffd61a15a334ce42f2a569c59f0270bcb Mon Sep 17 00:00:00 2001
2 From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
3 Date: Thu, 25 Feb 2010 10:25:18 +0000
4 Subject: Fix incorrect arguments to ioperm() call
6 The second argument of ioperm() is not the last port to be accessed
7 but rather length of the port range [port, port + len).
9 Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
10 Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
11 ---
12 diff --git a/hald/linux/addons/addon-imac-backlight.c b/hald/linux/addons/addon-imac-backlight.c
13 index e869192..54e4ea3 100644
14 --- a/hald/linux/addons/addon-imac-backlight.c
15 +++ b/hald/linux/addons/addon-imac-backlight.c
16 @@ -158,7 +158,8 @@ main (int argc, char **argv)
17 goto out;
20 - if (ioperm(0xB2, 0xB3, 1) < 0)
21 + /* Allow access to ports 0xB2 and 0xB3 */
22 + if (ioperm(0xB2, 2, 1) < 0)
24 HAL_ERROR (("ioperm failed (you should be root)."));
25 exit(1);
26 diff --git a/hald/linux/addons/addon-macbookpro-backlight.c b/hald/linux/addons/addon-macbookpro-backlight.c
27 index 2a6fef6..c1bbbac 100644
28 --- a/hald/linux/addons/addon-macbookpro-backlight.c
29 +++ b/hald/linux/addons/addon-macbookpro-backlight.c
30 @@ -507,7 +507,8 @@ main (int argc, char *argv[])
31 state = INREG(0x7ae4);
32 OUTREG(0x7ae4, state);
34 - if (ioperm (0x300, 0x304, 1) < 0) {
35 + /* Allow access to porta 0x300 through 0x304 */
36 + if (ioperm (0x300, 5, 1) < 0) {
37 HAL_ERROR (("ioperm failed (you should be root)."));
38 exit(1);
41 cgit v0.8.3-6-g21f6