Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/autofs/autounmountd.c
Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | main_autounmountd(int argc, char **argv) | ||||
pidfile_write(pidfh); | pidfile_write(pidfh); | ||||
TAILQ_INIT(&automounted); | TAILQ_INIT(&automounted); | ||||
kq = kqueue(); | kq = kqueue(); | ||||
if (kq < 0) | if (kq < 0) | ||||
log_err(1, "kqueue"); | log_err(1, "kqueue"); | ||||
EV_SET(&event, 0, EVFILT_FS, EV_ADD | EV_CLEAR, 0, 0, NULL); | EV_SET(&event, 0, EVFILT_FS, EV_ADD | EV_CLEAR, VQ_MOUNT | VQ_UNMOUNT, 0, NULL); | ||||
error = kevent(kq, &event, 1, NULL, 0, NULL); | error = kevent(kq, &event, 1, NULL, 0, NULL); | ||||
if (error < 0) | if (error < 0) | ||||
log_err(1, "kevent"); | log_err(1, "kevent"); | ||||
for (;;) { | for (;;) { | ||||
refresh_automounted(); | refresh_automounted(); | ||||
mounted_max = expire_automounted(expiration_time); | mounted_max = expire_automounted(expiration_time); | ||||
if (mounted_max == -1) { | if (mounted_max == -1) { | ||||
Show All 17 Lines |