diff options
-rw-r--r-- | src/evemu.c | 2 | ||||
-rw-r--r-- | src/evemu.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/evemu.c b/src/evemu.c index d279a6c..888ce3c 100644 --- a/src/evemu.c +++ b/src/evemu.c @@ -726,7 +726,7 @@ int evemu_play_one(int fd, const struct input_event *ev) { int ret; SYSCALL(ret = write(fd, ev, sizeof(*ev))); - return (ret == -1 || (size_t)ret < sizeof(*ev)); + return (ret == -1 || (size_t)ret < sizeof(*ev)) ? -1 : 0; } static void evemu_warn_about_incompatible_event(struct input_event *ev) diff --git a/src/evemu.h b/src/evemu.h index f438367..44634e8 100644 --- a/src/evemu.h +++ b/src/evemu.h @@ -393,6 +393,8 @@ int evemu_record(FILE *fp, int fd, int ms); * evemu_play_one() - play one event to kernel device * @fd: file descriptor of kernel device to write to * @ev: pointer to the kernel event to be played + * + * Returns zero if successful, negative error otherwise. */ int evemu_play_one(int fd, const struct input_event *ev); |