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

Diff for /src/usr.bin/wall/ttymsg.c between version 1.18 and 1.19

version 1.18, 2019/05/16 06:23:15 version 1.19, 2019/06/28 13:35:05
Line 91 
Line 91 
          * open will fail on slip lines or exclusive-use lines           * open will fail on slip lines or exclusive-use lines
          * if not running as root; not an error.           * if not running as root; not an error.
          */           */
         if ((fd = open(device, O_WRONLY|O_NONBLOCK, 0)) < 0) {          if ((fd = open(device, O_WRONLY|O_NONBLOCK, 0)) == -1) {
                 if (errno == EBUSY || errno == EACCES)                  if (errno == EBUSY || errno == EACCES)
                         return (NULL);                          return (NULL);
                 (void) snprintf(errbuf, sizeof(errbuf),                  (void) snprintf(errbuf, sizeof(errbuf),
Line 100 
Line 100 
         }          }
   
         if (getuid()) {          if (getuid()) {
                 if (fstat(fd, &st) < 0 ||                  if (fstat(fd, &st) == -1 ||
                     (st.st_mode & S_IWGRP) == 0) {                      (st.st_mode & S_IWGRP) == 0) {
                         close(fd);                          close(fd);
                         return (NULL);                          return (NULL);
Line 143 
Line 143 
                                 _exit(1);                                  _exit(1);
                         }                          }
                         cpid = fork();                          cpid = fork();
                         if (cpid < 0) {                          if (cpid == -1) {
                                 (void) snprintf(errbuf, sizeof(errbuf),                                  (void) snprintf(errbuf, sizeof(errbuf),
                                     "fork: %s", strerror(errno));                                      "fork: %s", strerror(errno));
                                 (void) close(fd);                                  (void) close(fd);

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19