Lines Matching refs:pfd
123 static bool init_inotify(pollfd *pfd) { in init_inotify() argument
127 pfd->fd = inotify_init1(IN_NONBLOCK); in init_inotify()
128 if (pfd->fd < 0) { in init_inotify()
130 } else if (inotify_add_watch(pfd->fd, NANOHUB_LOCK_DIR, IN_CREATE | IN_DELETE) < 0) { in init_inotify()
132 close(pfd->fd); in init_inotify()
134 pfd->events = POLLIN; in init_inotify()
141 static void discard_inotify_evt(pollfd &pfd) { in discard_inotify_evt() argument
142 if ((pfd.revents & POLLIN)) { in discard_inotify_evt()
144 int ret = read(pfd.fd, buf, sizeof(buf)); in discard_inotify_evt()
149 static void wait_on_dev_lock(pollfd &pfd) { in wait_on_dev_lock() argument
151 discard_inotify_evt(pfd); in wait_on_dev_lock()
154 int ret = poll(&pfd, 1, 5000); in wait_on_dev_lock()
156 discard_inotify_evt(pfd); in wait_on_dev_lock()