[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.38 and 1.39

version 1.38, 2017/07/08 22:19:23 version 1.39, 2017/07/08 22:22:04
Line 66 
Line 66 
   
 int     no_timeout;                     /* lock terminal forever */  int     no_timeout;                     /* lock terminal forever */
   
 extern  char *__progname;  
   
 /*ARGSUSED*/  
 int  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
Line 132 
Line 129 
                 default:                  default:
                         (void)fprintf(stderr,                          (void)fprintf(stderr,
                             "usage: %s [-np] [-a style] [-t timeout]\n",                              "usage: %s [-np] [-a style] [-t timeout]\n",
                             __progname);                              getprogname());
                         exit(1);                          exit(1);
                 }                  }
         }          }
Line 181 
Line 178 
         if (no_timeout) {          if (no_timeout) {
                 (void)fprintf(stderr,                  (void)fprintf(stderr,
                     "%s: %s on %s. no timeout\ntime now is %s\n",                      "%s: %s on %s. no timeout\ntime now is %s\n",
                     __progname, ttynam, hostname, date);                      getprogname(), ttynam, hostname, date);
         } else {          } else {
                 (void)fprintf(stderr,                  (void)fprintf(stderr,
                     "%s: %s on %s. timeout in %d minutes\ntime now is %s\n",                      "%s: %s on %s. timeout in %d minutes\ntime now is %s\n",
                     __progname, ttynam, hostname, sectimeout, date);                      getprogname(), ttynam, hostname, sectimeout, date);
         }          }
   
         for (cnt = 0;;) {          for (cnt = 0;;) {
Line 231 
Line 228 
         exit(0);          exit(0);
 }  }
   
 /*ARGSUSED*/  
 void  void
 hi(int signo)  hi(int signo)
 {  {
         struct itimerval left;          struct itimerval left;
   
         (void)dprintf(STDERR_FILENO, "%s: type in the unlock key.", __progname);          (void)dprintf(STDERR_FILENO, "%s: type in the unlock key.",
               getprogname());
         if (!no_timeout) {          if (!no_timeout) {
                 (void)getitimer(ITIMER_REAL, &left);                  (void)getitimer(ITIMER_REAL, &left);
                 (void)dprintf(STDERR_FILENO, " timeout in %lld:%02d minutes",                  (void)dprintf(STDERR_FILENO, " timeout in %lld:%02d minutes",
Line 247 
Line 244 
         (void)dprintf(STDERR_FILENO, "\n");          (void)dprintf(STDERR_FILENO, "\n");
 }  }
   
 /*ARGSUSED*/  
 void  void
 bye(int signo)  bye(int signo)
 {  {

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39