linput

Listen to input events
git clone git://git.akobets.xyz/linput
Log | Files | Refs | README | LICENSE

commit e9cedc6f5a63b1a9f0024e77382ad3029a62bb12
parent bae683a29a34cb6697dbc4c65b2fa91a2e8ea40a
Author: Artem Kobets <artem@akobets.xyz>
Date:   Sun,  3 May 2020 13:34:00 +0300

remove text

Diffstat:
Mlinput.c | 26+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/linput.c b/linput.c @@ -217,21 +217,21 @@ run(char **cmd) switch (fork()) { case -1: - fprintf(stderr, "linput: fork: %s\n", strerror(errno)); + fprintf(stderr, "fork: %s\n", strerror(errno)); break; case 0: /* drop setuid/setgid privileges */ if (setuid(getuid()) == -1) { - fprintf(stderr, "linput: setuid: %s\n", strerror(errno)); + fprintf(stderr, "setuid: %s\n", strerror(errno)); _exit(EXIT_FAILURE); } if (setgid(getgid()) == -1) { - fprintf(stderr, "linput: setgid: %s\n", strerror(errno)); + fprintf(stderr, "setgid: %s\n", strerror(errno)); _exit(EXIT_FAILURE); } execvp(cmd[0], cmd); - fprintf(stderr, "linput: execvp %s: %s\n", cmd[0], strerror(errno)); + fprintf(stderr, "execvp %s: %s\n", cmd[0], strerror(errno)); _exit(EXIT_FAILURE); break; } @@ -244,11 +244,11 @@ add_fd(int fd, const char *path) new = (fd_node *) malloc(sizeof(fd_node)); if (new == NULL) - die("linput: malloc: %s\n", strerror(errno)); + die("malloc: %s\n", strerror(errno)); new->fd = fd; new->path = strdup(path); if (new->path == NULL) - die("linput: strdup: %s\n", strerror(errno)); + die("strdup: %s\n", strerror(errno)); new->next = NULL; if (fd_head == NULL) { @@ -314,7 +314,7 @@ generate_poll_array() nfds = n; pfds = realloc(pfds, sizeof(struct pollfd) * n); if (pfds == NULL) - die("linput: realloc: %s\n", strerror(errno)); + die("realloc: %s\n", strerror(errno)); } pfds[0].fd = inotify_fd; @@ -363,13 +363,13 @@ init_input_files() res = glob("/dev/input/event*", 0, NULL, &pglob); if (res != 0) - die("linput: glob: can't find files in /dev/input/event*", strerror(errno)); + die("glob: can't find files in /dev/input/event*", strerror(errno)); for (i = 0; i < pglob.gl_pathc; i++) if (open_input_file(pglob.gl_pathv[i]) != -1) success = 1; if (!success) - die("linput: can't open any files in /dev/input/event*\n"); + die("can't open any files in /dev/input/event*\n"); globfree(&pglob); } @@ -380,12 +380,12 @@ init_inotify() inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); poll_change = 1; if (inotify_fd == -1) { - fprintf(stderr, "linput: inotify init failed (inotify_init): %s\n", strerror(errno)); + fprintf(stderr, "inotify init failed (inotify_init): %s\n", strerror(errno)); return; } if (inotify_add_watch(inotify_fd, "/dev/input", IN_CREATE | IN_ATTRIB) == -1) { - fprintf(stderr, "linput: inotify init failed (inotify_add_watch): %s\n", strerror(errno)); + fprintf(stderr, "inotify init failed (inotify_add_watch): %s\n", strerror(errno)); return; } } @@ -544,7 +544,7 @@ main(int argc, char **argv) } if (res == -1) - die("linput: poll: %s\n", strerror(errno)); + die("poll: %s\n", strerror(errno)); - die("linput: poll: unexpected error\n"); + die("poll: unexpected error\n"); }