redundant message on no devices

xkbcommon
Alessandro Mauri 4 years ago
parent 3c9bbe4140
commit cdfed84d5e
  1. 13
      hkd.c

13
hkd.c

@ -71,8 +71,16 @@ int main (void)
struct pollfd *fds = NULL;
update_descriptors_list(&fds, &fd_num);
if (!fd_num) {
fputs("Could not open any device, exiting\n", stderr);
if (fd_num) {
fprintf(stderr,
ANSI_COLOR_YELLOW
"Monitoring %d devices\n"
ANSI_COLOR_RESET, fd_num);
} else {
fprintf(stderr,
ANSI_COLOR_RED
"Could not open any devices, exiting\n"
ANSI_COLOR_RESET);
exit(-1);
}
// TODO: watch for events inside /dev/input and reload accordingly
@ -328,7 +336,6 @@ void update_descriptors_list (struct pollfd **fds, int *fd_num)
(*fds)[(*fd_num)].fd = tmp_fd;
(*fd_num)++;
}
fprintf(stderr,ANSI_COLOR_YELLOW "Monitoring %d devices\n" ANSI_COLOR_RESET, (*fd_num));
closedir(ev_dir);
}

Loading…
Cancel
Save