do -s processing, even if output not a tty
[unix-history] / usr / src / usr.bin / mail / lock.c
index d26f159..37bcf69 100644 (file)
@@ -1,4 +1,12 @@
-#
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)lock.c      5.2 (Berkeley) %G%";
+#endif not lint
 
 /*
  * A mailing program.
 
 /*
  * A mailing program.
@@ -9,8 +17,6 @@
 #include "rcv.h"
 #include <sys/stat.h>
 
 #include "rcv.h"
 #include <sys/stat.h>
 
-static char *SccsId = "@(#)lock.c      2.1 %G%";
-
 char   *maillock       = ".mail";              /* Lock suffix for mailname */
 char   *lockname       = "/usr/spool/mail/tmXXXXXX";
 char   locktmp[30];                            /* Usable lock temporary */
 char   *maillock       = ".mail";              /* Lock suffix for mailname */
 char   *lockname       = "/usr/spool/mail/tmXXXXXX";
 char   locktmp[30];                            /* Usable lock temporary */
@@ -22,7 +28,7 @@ static        int             locked;                 /* To note that we locked it */
  * We must, of course, be careful to remove the lock file by a call
  * to unlock before we stop.  The algorithm used here is to see if
  * the lock exists, and if it does, to check its modify time.  If it
  * We must, of course, be careful to remove the lock file by a call
  * to unlock before we stop.  The algorithm used here is to see if
  * the lock exists, and if it does, to check its modify time.  If it
- * is older than 30 seconds, we assume error and set our own file.
+ * is older than 5 minutes, we assume error and set our own file.
  * Otherwise, we wait for 5 seconds and try again.
  */
 
  * Otherwise, we wait for 5 seconds and try again.
  */
 
@@ -53,7 +59,7 @@ char *file;
                if (stat(curlock, &sbuf) < 0)
                        return(0);
                time(&curtime);
                if (stat(curlock, &sbuf) < 0)
                        return(0);
                time(&curtime);
-               if (curtime < sbuf.st_ctime + 30) {
+               if (curtime < sbuf.st_ctime + 300) {
                        sleep(5);
                        continue;
                }
                        sleep(5);
                        continue;
                }