summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2016-07-15 14:17:28 -0700
committerElliott Hughes <enh@google.com>2016-07-15 14:17:28 -0700
commitc733a763c0b38c5d1afbb95d1ff5291a7b7c4101 (patch)
treed55083e5a27b41e9e183f7a048f01236c304f324 /toolbox
parenta17427cb1e9caaeb4dde7184b05dfa4b3b1f7172 (diff)
downloadcore-c733a763c0b38c5d1afbb95d1ff5291a7b7c4101.tar.gz
core-c733a763c0b38c5d1afbb95d1ff5291a7b7c4101.tar.bz2
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 := \
OUR_TOOLS := \
getevent \
newfs_msdos \
- sendevent \
ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS)
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 @@
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/input.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-
-int sendevent_main(int argc, char *argv[])
-{
- int fd;
- ssize_t ret;
- int version;
- struct input_event event;
-
- if(argc != 5) {
- fprintf(stderr, "use: %s device type code value\n", argv[0]);
- return 1;
- }
-
- fd = open(argv[1], O_RDWR);
- if(fd < 0) {
- fprintf(stderr, "could not open %s, %s\n", argv[optind], strerror(errno));
- return 1;
- }
- if (ioctl(fd, EVIOCGVERSION, &version)) {
- fprintf(stderr, "could not get driver version for %s, %s\n", argv[optind], strerror(errno));
- return 1;
- }
- memset(&event, 0, sizeof(event));
- event.type = atoi(argv[2]);
- event.code = atoi(argv[3]);
- event.value = atoi(argv[4]);
- ret = write(fd, &event, sizeof(event));
- if(ret < (ssize_t) sizeof(event)) {
- fprintf(stderr, "write event failed, %s\n", strerror(errno));
- return -1;
- }
- return 0;
-}