*** pwcheck/pwcheck.c.orig	Fri May 15 23:55:22 1998
--- pwcheck/pwcheck.c	Wed Aug 26 11:28:01 1998
***************
*** 31,36 ****
--- 31,43 ----
  #include <sys/un.h>
  #include <sys/uio.h>
  #include <sys/stat.h>
+ #include <paths.h>
+ #include <unistd.h>
+ #include <syslog.h>
+ 
+ #if !defined(_PATH_PWCHECKPID)
+ # define _PATH_PWCHECKPID  _PATH_VARRUN "pwcheck.pid"
+ #endif
  
  extern int errno;
  
***************
*** 49,54 ****
--- 56,76 ----
      int r;
      int len;
      mode_t oldumask;
+     char *pid_file = _PATH_PWCHECKPID;
+     FILE *fp;
+     pid_t pid;
+ 
+     /*
+      *   Record process ID - shamelessly stolen from inetd (I.V.)
+      */
+     pid = getpid();
+     fp = fopen(pid_file, "w");
+     if (fp) {
+         fprintf(fp, "%ld\n", (long)pid);
+         fclose(fp);
+     } else {
+         syslog(LOG_WARNING, "%s: %m", pid_file);
+     }
  
      s = socket(AF_UNIX, SOCK_STREAM, 0);
      if (s == -1) {
