1
diff -ruN -x Makefile.in -x configure autofs-3.1.7.orig/daemon/automount.c autofs-3.1.7/daemon/automount.c
2
--- autofs-3.1.7.orig/daemon/automount.c Thu Jan 4 22:40:53 2001
3
+++ autofs-3.1.7/daemon/automount.c Thu Jan 4 22:40:46 2001
8
- ioctl(ap.ioctlfd, AUTOFS_IOC_CATATONIC, 0);
12
+ rv = spawnl(LOG_ERR, PATH_UMOUNT, PATH_UMOUNT, ap.path, NULL);
15
+ ap.ioctlfd = open(".", O_RDONLY); /* Root directory for ioctl()'s */
17
+ if ( ap.ioctlfd < 0 )
18
+ syslog(LOG_INFO, "can't reopen ioctlfd\n");
19
+ if ( ioctl(ap.ioctlfd, AUTOFS_IOC_PROTOVER, &kproto_version) ) {
20
+ syslog(LOG_DEBUG, "kproto on reawaken: %m");
24
+ syslog(LOG_INFO, "using kernel protocol version %d on reawaken", kproto_version);
26
+ if ( kproto_version < 3 ) {
27
+ ap.exp_timeout = ap.exp_runfreq = 0;
28
+ syslog(LOG_INFO, "kernel does not support timeouts");
30
+ unsigned long timeout;
32
+ ap.exp_runfreq = (ap.exp_timeout + CHECK_RATIO - 1) / CHECK_RATIO;
34
+ timeout = ap.exp_timeout;
35
+ ioctl(ap.ioctlfd, AUTOFS_IOC_SETTIMEOUT, &timeout);
37
+ /* We often start several automounters at the same time. Add some
38
+ randomness so we don't all expire at the same time. */
39
+ if ( ap.exp_timeout )
40
+ alarm(ap.exp_timeout + my_pid % ap.exp_runfreq);
50
- rv = spawnl(LOG_ERR, PATH_UMOUNT, PATH_UMOUNT, ap.path, NULL);
51
if (rv == 0 && submount)