File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,20 +53,20 @@ protected override void Run(Action readyCallback)
5353 int fd = NativeMethodsLibudev . Instance . udev_monitor_get_fd ( monitor ) ;
5454 RunAssert ( fd >= 0 , "HidSharp udev_monitor_get_fd failed." ) ;
5555
56- var fds = new NativeMethods . pollfd [ 1 ] ;
57- fds [ 0 ] . fd = fd ;
58- fds [ 0 ] . events = NativeMethods . pollev . IN ;
56+ var pfd = new NativeMethods . pollfd ( ) ;
57+ pfd . fd = fd ;
58+ pfd . events = NativeMethods . pollev . IN ;
5959
6060 readyCallback ( ) ;
6161 while ( true )
6262 {
63- ret = NativeMethods . retry ( ( ) => NativeMethods . poll ( fds , ( IntPtr ) 1 , - 1 ) ) ;
63+ ret = NativeMethods . retry ( ( ) => NativeMethods . poll ( ref pfd , ( IntPtr ) 1 , - 1 ) ) ;
6464 if ( ret < 0 ) { break ; }
6565
6666 if ( ret == 1 )
6767 {
68- if ( 0 != ( fds [ 0 ] . revents & ( NativeMethods . pollev . ERR | NativeMethods . pollev . HUP | NativeMethods . pollev . NVAL ) ) ) { break ; }
69- if ( 0 != ( fds [ 0 ] . revents & NativeMethods . pollev . IN ) )
68+ if ( 0 != ( pfd . events & ( NativeMethods . pollev . ERR | NativeMethods . pollev . HUP | NativeMethods . pollev . NVAL ) ) ) { break ; }
69+ if ( 0 != ( pfd . events & NativeMethods . pollev . IN ) )
7070 {
7171 IntPtr device = NativeMethodsLibudev . Instance . udev_monitor_receive_device ( monitor ) ;
7272 if ( device != null )
You can’t perform that action at this time.
0 commit comments