[BACK]Return to lock.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / lock

Diff for /src/usr.bin/lock/lock.c between version 1.41 and 1.42

version 1.41, 2017/09/06 21:02:31 version 1.42, 2019/07/05 14:11:26
Line 63 
Line 63 
   
 void bye(int);  void bye(int);
 void hi(int);  void hi(int);
   void usage(void);
   
   int     custom_timeout;
 int     no_timeout;                     /* lock terminal forever */  int     no_timeout;                     /* lock terminal forever */
   
 int  int
Line 84 
Line 86 
         sectimeout = TIMEOUT;          sectimeout = TIMEOUT;
         style = NULL;          style = NULL;
         usemine = 0;          usemine = 0;
         no_timeout = 0;          custom_timeout = no_timeout = 0;
         memset(&timeout, 0, sizeof(timeout));          memset(&timeout, 0, sizeof(timeout));
   
         if (pledge("stdio rpath wpath getpw tty proc exec", NULL) == -1)          if (pledge("stdio rpath wpath getpw tty proc exec", NULL) == -1)
Line 116 
Line 118 
                         usemine = 1;                          usemine = 1;
                         break;                          break;
                 case 't':                  case 't':
                           if (no_timeout)
                                   usage();
                         sectimeout = strtonum(optarg, 1, INT_MAX, &errstr);                          sectimeout = strtonum(optarg, 1, INT_MAX, &errstr);
                         if (errstr)                          if (errstr)
                                 errx(1, "timeout %s: %s", errstr, optarg);                                  errx(1, "timeout %s: %s", errstr, optarg);
                           custom_timeout = 1;
                         break;                          break;
                 case 'p':                  case 'p':
                         usemine = 1;                          usemine = 1;
                         break;                          break;
                 case 'n':                  case 'n':
                           if (custom_timeout)
                                   usage();
                         no_timeout = 1;                          no_timeout = 1;
                         break;                          break;
                 default:                  default:
                         fprintf(stderr,                          usage();
                             "usage: %s [-np] [-a style] [-t timeout]\n",  
                             getprogname());  
                         exit(1);  
                 }                  }
         }          }
         timeout.tv_sec = sectimeout * 60;          timeout.tv_sec = sectimeout * 60;
Line 251 
Line 255 
         if (!no_timeout)          if (!no_timeout)
                 warnx("timeout");                  warnx("timeout");
         _exit(1);          _exit(1);
   }
   
   void
   usage(void)
   {
           fprintf(stderr, "usage: %s [-np] [-a style] [-t timeout]\n",
               getprogname());
           exit(1);
 }  }

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42