- if (epoll_wait(epfd, &epev, 1, -1) < 0) {
- perror("error on epoll_wait");
- exit(-1);
- }
- if (epev.data.fd != fd)
- printf("something wrong, epoll activity on %i instead of %i\n",
- epev.data.fd, fd);
-
- if (ioctl(fd, FIONREAD, &size)) {
- perror("error on getting inotify event size");
- exit(-1);
- }
- if (size > sizeof(buffer)) {
- printf("Too many %i data to read, something wrong\n", size);
- exit(-1);
- }
- i = 0;
- while (i < size) {
- nread = read(fd, buffer, size);
- if (nread < 0) {