--- svscan.c.old	Thu Dec  2 06:46:51 1999
+++ svscan.c	Thu Dec  2 06:52:16 1999
@@ -1,5 +1,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <signal.h>
 #include "direntry.h"
 #include "strerr.h"
 #include "error.h"
@@ -89,6 +90,21 @@
     x[i].pid = 0;
     x[i].pidlog = 0;
     ++numx;
+  } else if (x[i].flaglog) {
+    if (!(st.st_mode & 01000)) { /* sticky bit vanished */
+	  kill(x[i]. pidlog,SIGTERM);
+      x[i].flaglog = 0;
+	  close(x[i].pi[0]);
+	  close(x[i].pi[1]);
+    }
+  } else if (st.st_mode & 01000) {
+    if (pipe(x[i].pi) == -1) {
+      strerr_warn4(WARNING,"unable to create pipe for ",fn,": ",&strerr_sys);
+      return;
+    }
+    coe(x[i].pi[0]);
+    coe(x[i].pi[1]);
+    x[i].flaglog = 1;
   }
 
   if (!x[i].pid)
