--- popper/main.c.orig	Wed Apr  4 02:23:26 2001
+++ popper/main.c	Fri Dec 28 11:18:39 2001
@@ -472,6 +472,22 @@
 
 #endif /* not _DEBUG */
 
+#ifdef PIDFILE
+    /*
+     * Write PID file. -- RSE
+     */
+    {
+        pid_t pid;
+        FILE *fp;
+
+        pid = getpid();
+        if ((fp = fopen(PIDFILE, "w")) == NULL)
+            err_dump(HERE, "Can't write pidfile '%s'", PIDFILE);
+        fprintf(fp, "%ld\n", (long)pid);
+        fclose(fp);
+    }
+#endif
+
     /*
      * Set up the socket on which we listen
      */
