This repository was archived by the owner on Apr 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 5656 return(EXIT_FAILURE); \
5757 } while(0)
5858
59+ // For compatibility with kernels having dates on 32 bits
60+ struct timeval_compat
61+ {
62+ unsigned int tv_sec ;
63+ long int tv_usec ;
64+ };
65+
66+ struct input_event_compat {
67+ struct timeval_compat time ;
68+ unsigned short type ;
69+ unsigned short code ;
70+ unsigned int value ;
71+ };
5972
6073/****************************************************************
6174 * Static functions declaration
@@ -185,7 +198,7 @@ int close_uinput(void)
185198
186199int sendKey (int key , int value )
187200{
188- struct input_event ie ;
201+ struct input_event_compat ie ;
189202 //memset(&uidev_ev, 0, sizeof(struct input_event));
190203 //gettimeofday(&uidev_ev.time, NULL);
191204 ie .type = EV_KEY ;
@@ -194,7 +207,7 @@ int sendKey(int key, int value)
194207 ie .time .tv_sec = 0 ;
195208 ie .time .tv_usec = 0 ;
196209 UINPUT_PRINTF ("sendKey: %d = %d\n" , key , value );
197- if (write (uidev_fd , & ie , sizeof (struct input_event )) < 0 )
210+ if (write (uidev_fd , & ie , sizeof (struct input_event_compat )) < 0 )
198211 die ("error: write" );
199212
200213 sendSync ();
You can’t perform that action at this time.
0 commit comments