home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / libpw / part01 / lockpwfile.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-15  |  291 b   |  20 lines

  1. /*
  2.  * lockpwfile - check for lockfile PTMP, when free, create it.
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include "defs.h"
  7.  
  8. lockpwfile()
  9. {
  10.     FILE    *pwd;
  11.  
  12.     while ((pwd = fopen(PTMP, "r")) != NULL) {
  13.         fclose(pwd);
  14. /*        printf("Password file locked.  Please wait...\n"); */
  15.         sleep(5);
  16.     }
  17.  
  18.     creat(PTMP, 022);
  19. }
  20.