+ struct pollfd pfd[1];
+ pfd[0].fd = completion_pipe[0];
+ pfd[0].events = POLLIN;
+ ret = poll(pfd, 1, 100);
+ if (ret == -1 && !INTERRUPTED_SYSCALL(errno))
+ error(1, errno, "poll main");
+ if (ret > 0 && (pfd[0].revents & POLLIN)) {
+ struct msg_info *mi;
+ read(completion_pipe[0], &mi, sizeof(mi));
+ if (opt.file)
+ msg_info_store(opt.file, mi);
+ msg_info_free(mi);
+ }
+
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ if (timespec_subtract(&diff, &next, &now)) {