summaryrefslogtreecommitdiff
path: root/toolbox
diff options
context:
space:
mode:
authorHarry Cutts <hcutts@google.com>2024-04-04 14:59:04 +0000
committerHarry Cutts <hcutts@google.com>2024-04-04 15:14:26 +0000
commit08686936b5cc986e576736275ce786792eecd72a (patch)
tree4eb180c4f7a255d59f3f4afac506b739dba81b89 /toolbox
parentb8f9475fd7185341377492355c27bcde4157c50a (diff)
downloadcore-08686936b5cc986e576736275ce786792eecd72a.tar.gz
getevent: print error message when failing to get event
For some reason we weren't saying what the error was here, which could be useful. Also change the failure message slightly to distinguish between failing to get inotify and evdev events. Bug: 245989146 Test: m toolbox Change-Id: I456aa53d008043ea2549024002f9b88ea8d2d2cf
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/getevent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toolbox/getevent.c b/toolbox/getevent.c
index f65bb20b5..7b896e9ec 100644
--- a/toolbox/getevent.c
+++ b/toolbox/getevent.c
@@ -441,7 +441,7 @@ static int read_notify(const char *dirname, int nfd, int print_flags)
if(res < (int)sizeof(*event)) {
if(errno == EINTR)
return 0;
- fprintf(stderr, "could not get event, %s\n", strerror(errno));
+ fprintf(stderr, "could not get inotify events, %s\n", strerror(errno));
return 1;
}
//printf("got %d bytes of event information\n", res);
@@ -664,7 +664,7 @@ int getevent_main(int argc, char *argv[])
if(ufds[i].revents & POLLIN) {
res = read(ufds[i].fd, &event, sizeof(event));
if(res < (int)sizeof(event)) {
- fprintf(stderr, "could not get event\n");
+ fprintf(stderr, "could not get evdev event, %s\n", strerror(errno));
return 1;
}
if(get_time) {