summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2016-07-15 16:17:28 -0500
committerElliott Hughes2016-07-15 16:17:28 -0500
commitc733a763c0b38c5d1afbb95d1ff5291a7b7c4101 (patch)
treed55083e5a27b41e9e183f7a048f01236c304f324 /toolbox
parenta17427cb1e9caaeb4dde7184b05dfa4b3b1f7172 (diff)
downloadplatform-system-core-c733a763c0b38c5d1afbb95d1ff5291a7b7c4101.tar.gz
platform-system-core-c733a763c0b38c5d1afbb95d1ff5291a7b7c4101.tar.xz
platform-system-core-c733a763c0b38c5d1afbb95d1ff5291a7b7c4101.zip
Lose sendevent to toybox.
Change-Id: I460b240c9cec0b0e966ab81ea6fdb0deb61c21bc
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/Android.mk1
-rw-r--r--toolbox/sendevent.c42
2 files changed, 0 insertions, 43 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index c9e2ddd90..4852fa4f8 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -33,7 +33,6 @@ BSD_TOOLS := \
33OUR_TOOLS := \ 33OUR_TOOLS := \
34 getevent \ 34 getevent \
35 newfs_msdos \ 35 newfs_msdos \
36 sendevent \
37 36
38ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS) 37ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS)
39 38
diff --git a/toolbox/sendevent.c b/toolbox/sendevent.c
deleted file mode 100644
index 4d0ca1760..000000000
--- a/toolbox/sendevent.c
+++ /dev/null
@@ -1,42 +0,0 @@
1#include <errno.h>
2#include <fcntl.h>
3#include <linux/input.h>
4#include <stdint.h>
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>
8#include <sys/ioctl.h>
9#include <unistd.h>
10
11int sendevent_main(int argc, char *argv[])
12{
13 int fd;
14 ssize_t ret;
15 int version;
16 struct input_event event;
17
18 if(argc != 5) {
19 fprintf(stderr, "use: %s device type code value\n", argv[0]);
20 return 1;
21 }
22
23 fd = open(argv[1], O_RDWR);
24 if(fd < 0) {
25 fprintf(stderr, "could not open %s, %s\n", argv[optind], strerror(errno));
26 return 1;
27 }
28 if (ioctl(fd, EVIOCGVERSION, &version)) {
29 fprintf(stderr, "could not get driver version for %s, %s\n", argv[optind], strerror(errno));
30 return 1;
31 }
32 memset(&event, 0, sizeof(event));
33 event.type = atoi(argv[2]);
34 event.code = atoi(argv[3]);
35 event.value = atoi(argv[4]);
36 ret = write(fd, &event, sizeof(event));
37 if(ret < (ssize_t) sizeof(event)) {
38 fprintf(stderr, "write event failed, %s\n", strerror(errno));
39 return -1;
40 }
41 return 0;
42}