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

Diff for /src/usr.bin/mesg/mesg.c between version 1.3 and 1.4

version 1.3, 1997/01/15 23:42:53 version 1.4, 1997/07/31 14:56:33
Line 81 
Line 81 
         argv += optind;          argv += optind;
   
         if ((tty = ttyname(STDERR_FILENO)) == NULL)          if ((tty = ttyname(STDERR_FILENO)) == NULL)
                 err(1, "ttyname");                  err(2, "ttyname");
         if (stat(tty, &sb) < 0)          if (stat(tty, &sb) < 0)
                 err(1, "%s", tty);                  err(2, "%s", tty);
   
         if (*argv == NULL) {          if (*argv == NULL) {
                 if (sb.st_mode & S_IWGRP) {                  if (sb.st_mode & S_IWGRP) {
Line 97 
Line 97 
         switch (*argv[0]) {          switch (*argv[0]) {
         case 'y':          case 'y':
                 if (chmod(tty, sb.st_mode | S_IWGRP) < 0)                  if (chmod(tty, sb.st_mode | S_IWGRP) < 0)
                         err(1, "%s", tty);                          err(2, "%s", tty);
                 exit(0);                  exit(0);
         case 'n':          case 'n':
                 if (chmod(tty, sb.st_mode & ~S_IWGRP) < 0)                  if (chmod(tty, sb.st_mode & ~S_IWGRP) < 0)
                         err(1, "%s", tty);                          err(2, "%s", tty);
                 exit(1);                  exit(1);
         }          }
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4