Skip to content

Commit 5055f65

Browse files
authored
Merge pull request #163 from FlorianNAdam/phys_again
2 parents d3d6fb9 + 7fee138 commit 5055f65

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/sys.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::compat::{
77
};
88
use nix::{
99
convert_ioctl_res, ioctl_none, ioctl_read, ioctl_read_buf, ioctl_readwrite, ioctl_write_int,
10-
ioctl_write_ptr, request_code_read,
10+
ioctl_write_ptr, ioctl_write_ptr_bad, request_code_read, request_code_write,
1111
};
1212

1313
#[repr(C)]
@@ -88,7 +88,17 @@ ioctl_write_int!(ui_set_mscbit, UINPUT_IOCTL_BASE, 104);
8888
ioctl_write_int!(ui_set_ledbit, UINPUT_IOCTL_BASE, 105);
8989
ioctl_write_int!(ui_set_sndbit, UINPUT_IOCTL_BASE, 106);
9090
ioctl_write_int!(ui_set_ffbit, UINPUT_IOCTL_BASE, 107);
91-
ioctl_write_ptr!(ui_set_phys, UINPUT_IOCTL_BASE, 108, libc::c_char);
91+
92+
ioctl_write_ptr_bad!(
93+
ui_set_phys,
94+
request_code_write!(
95+
UINPUT_IOCTL_BASE,
96+
108,
97+
::std::mem::size_of::<*const libc::c_char>()
98+
) as ::nix::sys::ioctl::ioctl_num_type,
99+
libc::c_char
100+
);
101+
92102
ioctl_write_int!(ui_set_swbit, UINPUT_IOCTL_BASE, 109);
93103
ioctl_write_int!(ui_set_propbit, UINPUT_IOCTL_BASE, 110);
94104

0 commit comments

Comments
 (0)